{"id":13454445,"url":"https://github.com/MeiK2333/github-style","last_synced_at":"2025-03-24T05:33:50.721Z","repository":{"id":37839413,"uuid":"216473473","full_name":"MeiK2333/github-style","owner":"MeiK2333","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-03T01:40:45.000Z","size":2410,"stargazers_count":624,"open_issues_count":29,"forks_count":201,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-23T19:08:55.824Z","etag":null,"topics":["blog","hugo","hugo-theme"],"latest_commit_sha":null,"homepage":"https://themes.gohugo.io/themes/github-style","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MeiK2333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T03:53:00.000Z","updated_at":"2025-03-20T15:26:02.000Z","dependencies_parsed_at":"2024-01-13T17:29:40.684Z","dependency_job_id":"41838460-8e95-4d2f-a73e-941f031c70b3","html_url":"https://github.com/MeiK2333/github-style","commit_stats":{"total_commits":157,"total_committers":33,"mean_commits":4.757575757575758,"dds":0.6178343949044586,"last_synced_commit":"74b2fa2fe04b84af6bf06618b01e72b70f92d930"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeiK2333%2Fgithub-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeiK2333%2Fgithub-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeiK2333%2Fgithub-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeiK2333%2Fgithub-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeiK2333","download_url":"https://codeload.github.com/MeiK2333/github-style/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217434,"owners_count":20579291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","hugo","hugo-theme"],"created_at":"2024-07-31T08:00:54.137Z","updated_at":"2025-03-24T05:33:50.714Z","avatar_url":"https://github.com/MeiK2333.png","language":"CSS","readme":"# github-style\n\n## Init hugo site\n\n```bash\nhugo new site mysite\ncd mysite\n```\n\n## Install the theme\n\n```bash\ngit submodule add git@github.com:MeiK2333/github-style.git themes/github-style\n```\n\n## Update the theme\n\nIf you just installed the theme, it is already in the latest version. If not, you can update using the below commands\n\n```bash\ncd themes/github-style\ngit pull\n```\n\nThen, you need to rename the previous `posts` folder to `post`\n\n```bash\ncd \u003cyou-project-folder\u003e\nmv content/posts content/post\n```\n\n## Setup readme\n\n```bash\nhugo new readme.md\necho '`Hello World!`' \u003e content/readme.md\n```\n\n## Pin post\n\n```\n---\npin: true\n---\n```\n\n## Add new post\n\nHugo will create a post with `draft: true`, change it to false in order for it to show in the website.\n\n```\nhugo new post/title_of_the_post.md\n```\n\n## Limit display content\n\n### Approach 1: use summary\n\n```\n---\ntitle: \"title\"\ndate: 2019-10-22T18:46:47+08:00\ndraft: false\nsummary: \"The summary content\"\n---\n```\n\n### Approach 2: use `\u003c!--more--\u003e`\n\nUse `\u003c!--more--\u003e` to separate content that will display in the posts page as abstraction and the rest of the content. This is different from summary, as summary will not appear in the post.\n```\n---\ntitle: \"title\"\ndate: 2019-10-22T18:46:47+08:00\ndraft: false\n---\nabstraction show in the post page\n\u003c!--more--\u003e\nother content\n```\n\n## Add last modified date\n\nadd to `config.toml`\n\n```toml\nlastmod = true\n\n[frontmatter]\n  lastmod = [\"lastmod\", \":fileModTime\", \":default\"]\n```\n\n## Use [gitalk](https://github.com/gitalk/gitalk) to support comments\n\nadd to `config.toml`\n\n```toml\nenableGitalk = true\n\n  [params.gitalk]\n    clientID = \"Your client ID\"\n    clientSecret = \"Your client secret\"\n    repo = \"repo\"\n    owner = \"Your Github username\"\n    admin = \"Your Github username\"\n    id = \"location.pathname\"\n    labels = \"gitalk\"\n    perPage = 30\n    pagerDirection = \"last\"\n    createIssueManually = true\n    distractionFreeMode = false\n```\n\n## Support LaTeX\n\nIn you post add `math: true` to [front matter](https://gohugo.io/content-management/front-matter/)\n\n```\n---\nkatex: math\n---\n```\n\nThen the [katex script](https://katex.org/docs/autorender.html) will auto render the string enclosed by delimiters.\n\n```\n# replace ... with latex formula\ndisplay inline \\\\( ... \\\\)\ndisplay block $$ ... $$\n```\n\n![latex example](https://raw.githubusercontent.com/MeiK2333/github-style/master/images/latex_example.png)\n\n## Support MathJax\nyou can add MathJax:true to frontmatter\n\n```\nmathJax: true\n```\n\n## Custom CSS and JS\n\nAdd your files in the static folder and list them in the custom_css and custom_js parameters\n\nFor example, with static/css/custom.css and static/js/custom.js, add to `config.toml`\n\n```toml\n[params]\n  custom_css = [\"css/custom.css\"]\n  custom_js = [\"js/custom.js\"]\n```\n\n## config.toml example\n\n```toml\nbaseURL = \"https://meik2333.com/\"\nlanguageCode = \"zh-cn\"\ntitle = \"MeiK's blog\"\ntheme = \"github-style\"\npygmentsCodeFences = true\npygmentsUseClasses = true\n\n[params]\n  author = \"MeiK\"\n  description = \"In solitude, where we are least alone.\"\n  github = \"MeiK2333\"\n  facebook = \"MeiK2333\"\n  twitter = \"MeiK2333\"\n  linkedin = \"MeiK2333\"\n  instagram = \"MeiK2333\"\n  tumblr = \"MeiK2333\"\n  email = \"meik2333@gmail.com\"\n  url = \"https://meik2333.com\"\n  keywords = \"blog, google analytics\"\n  rss = true\n  lastmod = true\n  userStatusEmoji = \"😀\"\n  favicon = \"/images/github.png\"\n  avatar = \"/images/avatar.png\"\n  headerIcon = \"/images/GitHub-Mark-Light-32px.png\"\n  location = \"China\"\n  enableGitalk = true\n  custom_css = [\"css/custom.css\"]\n  custom_js = [\"js/custom.js\"]\n\n  [params.gitalk]\n    clientID = \"Your client ID\"\n    clientSecret = \"Your client secret\"\n    repo = \"repo\"\n    owner = \"MeiK2333\"\n    admin = \"MeiK2333\"\n    id = \"location.pathname\"\n    labels = \"gitalk\"\n    perPage = 15\n    pagerDirection = \"last\"\n    createIssueManually = true\n    distractionFreeMode = false\n\n  [[params.links]]\n    title = \"Link\"\n    href = \"https://github.com/meik2333\"\n  [[params.links]]\n    title = \"Link2\"\n    href = \"https://meik2333.com\"\n    icon = \"https://meik2333.com/images/avatar.png\"\n\n[frontmatter]\n  lastmod = [\"lastmod\", \":fileModTime\", \":default\"]\n\n[services]\n  [services.googleAnalytics]\n    ID = \"UA-123456-789\"\n\n```\n\n## Support collapsible block\n\nYou can create a collapsible block like this:\n\n```\n{{\u003cdetails \"summary title\"\u003e}}\n\nblock content\n\n{{\u003c/details\u003e}}\n```\n\nAnd it will show like this:\n\n\u003cdetails\u003e\n  \u003csummary\u003esummary title\u003c/summary\u003e\n  \u003cp\u003eblock content\u003c/p\u003e\n\u003c/details\u003e\n\n## Support local search\n\nadd to `config.toml`\n\n```toml\n[params]\n  enableSearch = true\n\n[outputs]\n  home = [\"html\", \"json\"]\n\n[outputFormats.json]\n  mediaType = \"application/json\"\n  baseName = \"index\"\n  isPlainText = false\n```\n\nWe can do local search now, it is implemented by `fuse.js`.\n\n## deploy.sh example\n\nThere are various way to deploy to github, here is a link to official [document](https://gohugo.io/hosting-and-deployment/hosting-on-github/).\n\nHere is an sample. Note line 22 have `env HUGO_ENV=\"production\"`, makes sure googleAnalysis is loaded during production, but is not loaded when we are testing it in localhost.\n\n```bash\n#!/bin/sh\n\nif [ \"`git status -s`\" ]\nthen\n    echo \"The working directory is dirty. Please commit any pending changes.\"\n    exit 1;\nfi\n\necho \"Deleting old publication\"\nrm -rf public\nmkdir public\ngit worktree prune\nrm -rf .git/worktrees/public/\n\necho \"Checking out gh-pages branch into public\"\ngit worktree add -B gh-pages public origin/gh-pages\n\necho \"Removing existing files\"\nrm -rf public/*\n\necho \"Generating site\"\nenv HUGO_ENV=\"production\" hugo -t github-style\n\necho \"Updating gh-pages branch\"\ncd public \u0026\u0026 git add --all \u0026\u0026 git commit -m \"Publishing to gh-pages (publish.sh)\"\n\n#echo \"Pushing to github\"\n#git push --all\n```\n\nThen you can verify the site is working and use `git push --all` to push the change to github. If you don't want to check again every time, you can uncomment the `#git push --all` in the script.\n\n## TODO\n\n- 重写标题导航，那玩意儿引入的 JS 在控制台报错。\n","funding_links":[],"categories":["CSS","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMeiK2333%2Fgithub-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMeiK2333%2Fgithub-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMeiK2333%2Fgithub-style/lists"}