![]() Src/routes/api.js // File to implement the functionality to retrieve post dynamically Src/routes/posts -> // Endpoints and pages for the route /posts/ Src/routes/ -> // Router with all available pages Src/posts/second-post.md -> // markdown for second post Src/posts/first-post.md -> // markdown for first post Src/posts/ -> // Directory for Markdown post files Src/lib/handle-markdown.js -> // File to handle markdown Src/lib/ -> // Directory for building our pages from markdown Src/components/post-card.svelte -> // Post card component First, we need to define our project structure and create some directories and files as indicated below: src/components/ -> // Svelte Components directory In this section, we’ll go over building a video blog. Svelte will start a development environment accessible by default at Building the video blog ![]() Remark remark-html rehype # For HTML parsing Code language: PHP ( php ) The additional packages we installed are explained below: glob # To import multiple files with a * syntaxįront-matter # To extract frontmatter and body from markdown cd video-blog-in-svelte & npm i & npm i glob front-matter remark remark-html rehype & npm run dev Next, we need to navigate into the project directory, install some additional packages we will use later in this article and start the development server using the command below. The command creates a Svelte project called video-blog-in-svelte. To create a new project, use the command below to scaffold a new project: npm init Code language: HTML, XML ( xml )Ī series of prompts will appear as a result of the command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |