Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remark excerpt cuts all after mark, no way to display the rest. #2

Open
git-no opened this issue Apr 18, 2022 · 3 comments
Open

Remark excerpt cuts all after mark, no way to display the rest. #2

git-no opened this issue Apr 18, 2022 · 3 comments

Comments

@git-no
Copy link

git-no commented Apr 18, 2022

Remark excerpt hides all after the mark. That is fine but there is no way to show the rest because there is not button / function to display the rest after the mark.

As a Remark plugin in preprocessing, e..g. Vite, Svekte, mdsvex I do not see ho to use this plugin to show all content after the mark.

mdsvex.config.js

import { defineMDSveXConfig as defineConfig } from 'mdsvex';
import excerpt from 'remark-excerpt';
// import examples from './src/lib/remark.js'

const config = defineConfig({
	extensions: ['.svelte.md', '.md', '.svx'],

	smartypants: {
		dashes: 'oldschool'
	},

	remarkPlugins: [excerpt],
	rehypePlugins: []
})

export default config
@thebrianbug
Copy link

I'm confused about this as well 😕

@manovotny
Copy link
Owner

This repo has not seen an update in three years. 😱 I am sure some things have changed within the ecosystem that require changes here as well.

Would either of you be willing to create a minimal reproducible repo with the issues you're seeing? I'd be happy to take a look.

@thebrianbug
Copy link

thebrianbug commented Sep 22, 2022

ok! In the meantime, you can (I hope?) use this to reproduce, sorry that it's not yet minimal: https://github.com/spences10/sveltekit-mdsvex-starter-blog. You can also do the same for my WIP blog: https://github.com/bmcilw1/technicallyemployed, also not yet minimal.

  1. Install your plugin
  2. Add it to the mdsvex file as shown here above ^ Remark excerpt cuts all after mark, no way to display the rest. #2 (comment)
  3. Run the blog and click on a post. You only see the excerpt all the time, even when you want to see the full post.

I want to get the pre-processed excerpt as a property in the metadata object for a post called excerpt, rather than overwriting what otherwise returns the full post. I still want all the same remark/rehype plugins to apply to the excerpt that do to the full post. We want to be able to show just the excerpt on the post summary and the full post when rendering the full post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants