First github.com/xitu/juejin… This is the mining open source theme customization warehouse.

Now the rules

How can I contribute to Markdown topics

  1. Create a public repository using the default template (click the green Use This Template button)
  2. Replace juejin. SCSS with your own styles, currently supporting Sass, Less and CSS
  3. Fork the repository and clone it to the local directory. Specify the path of the style file in the themes.js file, ref for commit hash
  4. Add your topic and author information in the community Topics section of readme.md
  5. Submit a pull request

Step 1 Use this template

Clicking on Use this Template will take you to the create repository page and tell you that the new repository will have the same files and folders as Xitu/Juejin-Markdown-Heme-default.

For the name of the repository, use ->Juejin -markdown-theme-{your theme name}I already have it here, so of course the cue is there.

Important note

Important note, the following content is not applicable to the new version of the development tool, do not continue to use!

The old version of the tool has been merged into the Mining theme development tool and the new version of the development tool has greatly simplified the logic and made it easier to use

Important note, the following content is not applicable to the new version of the development tool, do not continue to use!


The second step is Clone warehouse & development

1. Clone the local repository

git cloneSubject item URLCopy the code

2. Develop an article theme style

Rename the juejin. SCSS file in your project to your theme name. Currently, Sass, Less, and CSS are supported

The official style editor for the Nuggets is not available yet, but it will come later.

So I first implemented one that would synchronize the content of the article and render the style results at the same timeNuggets markdown theme development tool.

Update: Theme development tools have been merged into

Clone the repository locally and change the style file name and article ID to your own.

2.1. Install the dependencies first

npm i
Copy the code

Create a new file with the same name as your theme. For example: my theme is called Cyanosis. SCSS then create a file with the same name (Cyanosis.

Then, go to the index.js file,

// index.js
// For this theme style file: Cyanosis. SCSS
Synchronous preview articles: / / https://juejin.im/post/6865308620876808199

// The parameter is the style file & the article ID
run('cyanosis.scss'.'6865308620876808199');
Copy the code

2.2. Launch preview

npm run dev
Copy the code

3. Synchronize topics to the repository

Find the cp.js file and modify the following information

// For this theme style file: Cyanosis. SCSS
// Style theme project directory: relative and absolute paths are available. Please leave the trailing slash /

copyFile('cyanosis.scss'.'.. /juejin-markdown-theme-cyanosis/');
Copy the code

Sync command to synchronize written style files to your theme repository

npm run cp
Copy the code

4. Submit the code

After the above styles are developed and synchronized to your own repository, you can push and submit the code to your own theme repository.

Step 3: Submit your PR

  1. First Fork the Juejin-Markdown-themes master repository
  2. When the Fork is complete, clone the repository locally
  3. Create a new branch with the same name as the theme
  4. findthemes.jsFile, and continue to add the following information(Note: Do not delete other people's information)
cyanosis: { // The subject name
    owner: 'linxsbox'.// Github user name
    repo: 'juejin-markdown-theme-cyanosis'.// The name of the theme repository
    path: 'cyanosis.scss'.// Theme file
    ref: 'a17ed6e'.// Commit hash key
  },
Copy the code

Get the commit hash key

Also remember to add your topic and author information in the “Community Topics” section of readme.md.

Finally push submit code! After successful submission, you can use this branch to submit PR.

Important note

Nuggets markdown theme development toolJust for the convenience of the current development theme!

Do not start multiple times in a short time, the access to the gold API interface is limited!

We are not responsible for the blocked IP caused by multiple malicious calls to the mining API interface!

To reduce frequent rendering, multiple file changes within 2 seconds will not take effect!

The last

I am very pleased to be invited by the Nuggets as the first edition theme style developer.

I hope you can contribute your own topics as well. We also hope that you will abide by the open source rules while contributing to the topic, and try to avoid unauthorized/plagiarized content.

Everyone is welcome to use the Cyanosis article theme, and suggestions for changes are also welcome!