diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..54c8762 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# https://github.com/github/gitignore/blob/main/community/Golang/Hugo.gitignore + +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +.hugo_build.lock diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..c6f3fce --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/assets/img/author.jpg b/assets/img/author.jpg new file mode 100644 index 0000000..1a5d28c Binary files /dev/null and b/assets/img/author.jpg differ diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml new file mode 100644 index 0000000..82fb750 --- /dev/null +++ b/config/_default/hugo.toml @@ -0,0 +1,8 @@ +# config/_default/config.toml + +baseURL = "https://Guanran928.github.io/" + +languageCode = 'zh-cn' +defaultContentLanguage = 'zh-cn' +#defaultContentLanguageInSubdir = true +hasCJKLanguage = true diff --git a/config/_default/languages.en.toml b/config/_default/languages.en.toml new file mode 100644 index 0000000..befdb65 --- /dev/null +++ b/config/_default/languages.en.toml @@ -0,0 +1,13 @@ +# config/_default/languages.en.toml + +languageCode = "en" +languageName = "English" + +title = "Guanran928's blog." + +[author] +name = "Guanran928" +image = "img/author.jpg" +headline = "This is me, probably." +bio = "Not a developer." +links = [{ github = "https://github.com/Guanran928" }] diff --git a/config/_default/languages.zh-cn.toml b/config/_default/languages.zh-cn.toml new file mode 100644 index 0000000..b1bd00e --- /dev/null +++ b/config/_default/languages.zh-cn.toml @@ -0,0 +1,13 @@ +# config/_default/languages.zh-cn.toml + +languageCode = "zh-cn" +languageName = "简体中文" + +title = "Guanran928's 的博客。" + +[author] +name = "Guanran928" +image = "img/author.jpg" +headline = "这有可能是我。" +bio = "我不是程序员。" +links = [{ github = "https://github.com/Guanran928" }] diff --git a/config/_default/menus.en.toml b/config/_default/menus.en.toml new file mode 100644 index 0000000..71b8554 --- /dev/null +++ b/config/_default/menus.en.toml @@ -0,0 +1,23 @@ +# config/_default/menus.en.toml + +#[[main]] +# name = "Blog" +# pageRef = "posts" +# weight = 10 + +[[main]] +name = "GitHub" +url = "https://github.com/Guanran928/Guanran928.github.io" +weight = 30 + +[main.params] +icon = "github" +showName = false +target = "_blank" + +[[main]] +identifier = "search" +weight = 99 +[main.params] +action = "search" +icon = "search" diff --git a/config/_default/menus.zh-cn.toml b/config/_default/menus.zh-cn.toml new file mode 100644 index 0000000..a2ab7cc --- /dev/null +++ b/config/_default/menus.zh-cn.toml @@ -0,0 +1,29 @@ +# config/_default/menus.zh-cn.toml + + +[[main]] +name = "文章" +pageRef = "posts" +weight = 10 + +[[main]] +name = "标签" +pageRef = "tags" +weight = 20 + +[[main]] +name = "GitHub" +url = "https://github.com/Guanran928/Guanran928.github.io" +weight = 30 + +[main.params] +icon = "github" +showName = false +target = "_blank" + +[[main]] +identifier = "search" +weight = 99 +[main.params] +action = "search" +icon = "search" diff --git a/config/_default/module.toml b/config/_default/module.toml new file mode 100644 index 0000000..03049d0 --- /dev/null +++ b/config/_default/module.toml @@ -0,0 +1,2 @@ +[[imports]] +path = "github.com/jpanther/congo/v2" diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..b5b0f13 --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,20 @@ +# config/_default/params.toml + +colorScheme = "ocean" +enableSearch = true +enableCodeCopy = true + +[homepage] +layout = "profile" + +[header] +#layout = "hamburger" + +[article] +showBreadcrumbs = true +showTableOfContents = true +showWordCount = true + +[list] +showBreadcrumbs = true +showTableOfContents = true diff --git a/content/posts/.gitkeep b/content/posts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..557beca --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704420045, + "narHash": "sha256-C36QmoJd5tdQ5R9MC1jM7fBkZW9zBUqbUCsgwS6j4QU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c1be43e8e837b8dbee2b3665a007e761680f0c3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8731286 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + description = "Guanran928's blog"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = inputs: + inputs.flake-utils.lib.eachDefaultSystem (system: let + pkgs = inputs.nixpkgs.legacyPackages.${system}; + in { + ### nix fmt + formatter = inputs.nixpkgs.legacyPackages.${system}.alejandra; + + ### nix develop + devShells.default = pkgs.mkShell {packages = with pkgs; [hugo go];}; + }); +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f83bceb --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module myblog + +go 1.21.5 + +require github.com/jpanther/congo/v2 v2.7.6 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d5b9574 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/jpanther/congo/v2 v2.7.6 h1:gBz+Zx6PIVgMhknn0t9uOUQA0sSBFKhH4Miox/q9xew= +github.com/jpanther/congo/v2 v2.7.6/go.mod h1:1S7DRoO1ZYS4YUdFd1LjTkdyjQwsjFWd8TqSfz3Jd+M= diff --git a/i18n/.gitkeep b/i18n/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/layouts/.gitkeep b/layouts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/themes/.gitkeep b/themes/.gitkeep new file mode 100644 index 0000000..e69de29