Skip to content

sourcesnippet/sourcesnippet.github.io

Repository files navigation

SourceSnippet Logo

built with MDX built with Node.js Hosted on github pages


A static website containing reuseable code snippets with zero fluff.

Website Screenshot

💻 Setup Locally

  1. Make sure you have node.js installed along with npm.
  2. Clone this repository:
    git clone https://github.com/sourcesnippet/sourcesnippet.github.io
    
  3. Navigate into the repository folder:
    cd sourcesnippet.github.io
    
  4. Install Dependencies:
    npm i 
    
  5. Run the start command & you will see the website on localhost:3000
    npm run start
    

🤝 Contribution

To add your own snippet do the following:

  1. Create a new folder inside snippets/ & make sure there is no whitespace in the folder name.
  2. Inside the newly created folder create an index.mdx file, You can use the following template to get started:
    export const metaData = {
        title: 'Your Title',
        thumbnail: "your-thumbnail.webp",
        author: "Your Name",                        // Optional
        authorWebsite: "https://yourwebsite.com/",  // Optional
        createdOnDate: new Date("2023-11-01"), 
        editedOnDate: new Date("2023-11-12"),       // Optional
        tags: ["your", "tags", "here"],
        keywords: ["your", "keywords", "here"]      // Optional, These are used purely in searching
    };
    
    
    How to write Hello World:
    
    <CodeTabs id={"My-Code-Block"} activeIndex={1} dropdown={true} childrenStyle={"background-color:blue"}> 
    ```Python
    print("Hello World")
    ```
    
    ```txt display-name="Custom Name" style="background-color:green; height:10rem"
    Hello World!
    ```
    </CodeTabs>
  3. You can also create styles.css & script.js files for custom styling & scripting (They will automatically be linked).
  4. Once you've created your snippet rebuild the site to make sure everything is working & follows the guidelines.

📜 Guidelines

  1. Make sure your snippets are short and to the point (No one wants to hear your backstory).
  2. Add links for any references, sources, credits at the bottom if used.
  3. Make sure to give your files & folder a relevant name in kebab-case while avoiding words like "a", "and", "the", "is", etc.
  4. Tag names should follow stackoverflow's tags naming convention & ideally no more than 5 tags per snippet.
  5. Compress your images & gifs before adding them in your snippet. Videos have to be hosted externally and embedded into the snippet.
  6. Do not add any low effort AI generated slop otherwise you will be banned from any further contributions.

Note:
Before adding your own snippet take a look at existing snippets especially if you're not sure of any conventions.

🔑 License

MIT NON-AI © Manas Ravindra Makde

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors