├── .bazelversion ├── .gitignore ├── site_simple ├── assets │ └── _custom.scss ├── site_test.sh ├── resources │ └── _gen │ │ └── assets │ │ └── scss │ │ ├── book.scss_48b060fe05b0a273d182ef83c0605941.json │ │ └── book.scss_48b060fe05b0a273d182ef83c0605941.content ├── content │ ├── docs │ │ ├── bazel.md │ │ ├── proto.md │ │ ├── hidden.md │ │ ├── sub-section │ │ │ ├── _index.md │ │ │ ├── natusque.md │ │ │ └── ego-numen.md │ │ ├── chrystl.md │ │ ├── open-source.md │ │ ├── contact.md │ │ ├── about.md │ │ ├── without-toc.md │ │ ├── with-toc.md │ │ └── products.md │ ├── menu │ │ └── index.md │ └── _index.md ├── BUILD.bazel └── config.yaml ├── .bazeliskrc ├── site_complex ├── content │ └── en │ │ ├── contributing │ │ ├── _index.md │ │ └── code_of_conduct.md │ │ └── _index.md ├── config │ └── _default │ │ ├── languages.yaml │ │ ├── params.yaml │ │ └── config.yaml ├── data │ └── menu │ │ └── main.yaml └── BUILD ├── .cirrus.yml ├── hugo ├── rules.bzl ├── internal │ ├── hugo_theme.bzl │ ├── github_hugo_theme.bzl │ ├── hugo_repository.bzl │ └── hugo_site.bzl └── BUILD ├── LICENSE ├── WORKSPACE └── README.md /.bazelversion: -------------------------------------------------------------------------------- 1 | 5.3.0 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bazel-* 2 | -------------------------------------------------------------------------------- /site_simple/assets/_custom.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | -------------------------------------------------------------------------------- /.bazeliskrc: -------------------------------------------------------------------------------- 1 | BAZELISK_BASE_URL=https://github.com/bazelbuild/bazel/releases/download 2 | -------------------------------------------------------------------------------- /site_complex/content/en/contributing/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Contributing" 3 | weight: 1 4 | --- 5 | 6 | # Introduction -------------------------------------------------------------------------------- /site_complex/content/en/contributing/code_of_conduct.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Code of Conduct" 3 | weight: 2 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /site_complex/content/en/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Testing complex sites" 3 | --- 4 | 5 | ## Introduction 6 | 7 | This adds the config directory to the build path, allowing multilanguage support. 8 | 9 | -------------------------------------------------------------------------------- /site_simple/site_test.sh: -------------------------------------------------------------------------------- 1 | set -euxo pipefail 2 | 3 | find . 4 | 5 | # Make a few assertions about the generated site 6 | test -f site_simple/site_simple/index.html 7 | test -f site_simple/site_simple/index.xml 8 | -------------------------------------------------------------------------------- /site_simple/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json: -------------------------------------------------------------------------------- 1 | {"Target":"book.min.b7d5ee4f671b06dde5fd61ab409a54048ba7759e99fed39ac32a7be45d4d92cd.css","MediaType":"text/css","Data":{"Integrity":"sha256-t9XuT2cbBt3l/WGrQJpUBIundZ6Z/tOawyp75F1Nks0="}} -------------------------------------------------------------------------------- /site_simple/content/docs/bazel.md: -------------------------------------------------------------------------------- 1 | # bazel.stack.build 2 | 3 | is a hosted bazel repository browser that allows the 4 | community to browse public bazel repositories (hosted on GitHub and similar services) 5 | 6 | ## Status 7 | 8 | Planned public release **Q2/Q3 2019** -------------------------------------------------------------------------------- /site_simple/content/menu/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | headless: true 3 | --- 4 | 5 | 7 | 8 | - [**Docs**]({{< relref "/" >}}) 9 | - [**GitHub**](https://github.com/stackb/rules_hugo) 10 | -------------------------------------------------------------------------------- /.cirrus.yml: -------------------------------------------------------------------------------- 1 | --- 2 | build_task: 3 | container: 4 | image: l.gcr.io/google/bazel:1.1.0 5 | build_and_test_script: bazel test 6 | --spawn_strategy=sandboxed 7 | --strategy=Javac=sandboxed 8 | --genrule_strategy=sandboxed 9 | --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST 10 | //site_simple:site_test 11 | -------------------------------------------------------------------------------- /hugo/rules.bzl: -------------------------------------------------------------------------------- 1 | load("//hugo:internal/hugo_repository.bzl", _hugo_repository = "hugo_repository") 2 | load("//hugo:internal/hugo_site.bzl", _hugo_site = "hugo_site", _hugo_serve = "hugo_serve") 3 | load("//hugo:internal/hugo_theme.bzl", _hugo_theme = "hugo_theme") 4 | load("//hugo:internal/github_hugo_theme.bzl", _github_hugo_theme = "github_hugo_theme") 5 | 6 | hugo_repository = _hugo_repository 7 | 8 | hugo_serve = _hugo_serve 9 | 10 | hugo_site = _hugo_site 11 | 12 | hugo_theme = _hugo_theme 13 | 14 | github_hugo_theme = _github_hugo_theme 15 | -------------------------------------------------------------------------------- /hugo/internal/hugo_theme.bzl: -------------------------------------------------------------------------------- 1 | def _hugo_theme_impl(ctx): 2 | return struct( 3 | hugo_theme = struct( 4 | name = ctx.attr.theme_name or ctx.label.name, 5 | path = ctx.label.package, 6 | files = depset(ctx.files.srcs), 7 | ), 8 | ) 9 | 10 | hugo_theme = rule( 11 | attrs = { 12 | "theme_name": attr.string( 13 | ), 14 | "srcs": attr.label_list( 15 | mandatory = True, 16 | allow_files = True, 17 | ), 18 | }, 19 | implementation = _hugo_theme_impl, 20 | ) 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 PubRef.org 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you 4 | may not use this file except in compliance with the License. You may 5 | obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | implied. See the License for the specific language governing 13 | permissions and limitations under the License. 14 | -------------------------------------------------------------------------------- /hugo/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /site_simple/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_site", "hugo_theme", "hugo_serve") 2 | 3 | hugo_theme( 4 | name = "book", 5 | srcs = [ 6 | "@com_github_alex_shpak_hugo_book//:files", 7 | ], 8 | ) 9 | 10 | hugo_site( 11 | name = "site_simple", 12 | config = "config.yaml", 13 | content = glob(["content/**"]), 14 | static = glob(["static/**"]), 15 | layouts = glob(["layouts/**"]), 16 | theme = ":book", 17 | ) 18 | 19 | hugo_serve( 20 | name = "site_serve", 21 | dep = [":site_simple"], 22 | ) 23 | 24 | sh_test( 25 | name = "site_test", 26 | srcs = ["site_test.sh"], 27 | data = [":site_simple"], 28 | ) -------------------------------------------------------------------------------- /site_complex/config/_default/languages.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | --- 15 | en: 16 | languageName: "English" 17 | contentDir: "content/en" 18 | weight: 10 19 | -------------------------------------------------------------------------------- /site_complex/data/menu/main.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | --- 16 | main: 17 | - name: 18 | en: Contributing 19 | sub: 20 | - name: 21 | en: Code of Conduct 22 | ref: "/contributing/code_of_conduct" 23 | ref: "/contributing" -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "build_stack_rules_hugo") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | load("@build_stack_rules_hugo//hugo:rules.bzl", "github_hugo_theme", "hugo_repository") 6 | 7 | hugo_repository( 8 | name = "hugo", 9 | extended = True, 10 | version = "0.101.0", 11 | ) 12 | 13 | github_hugo_theme( 14 | name = "com_github_alex_shpak_hugo_book", 15 | commit = "07048f7bf5097435a05c1e8b77241b0e478023c2", # June 3, 2019 16 | sha256 = "2897befb721e2bde54bb8acb43887d84c2855956f8efad5bd761628fe7fe5339", 17 | owner = "alex-shpak", 18 | repo = "hugo-book", 19 | ) 20 | 21 | http_archive( 22 | name = "com_github_thegeeklab_hugo_geekdoc", 23 | url = "https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.34.2/hugo-geekdoc.tar.gz", 24 | sha256 = "7fdd57f7d4450325a778629021c0fff5531dc8475de6c4ec70ab07e9484d400e", 25 | build_file_content=""" 26 | filegroup( 27 | name = "files", 28 | srcs = glob(["**"]), 29 | visibility = ["//visibility:public"] 30 | ) 31 | """ 32 | ) -------------------------------------------------------------------------------- /hugo/internal/github_hugo_theme.bzl: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 2 | 3 | DEFAULT_BUILD_FILE = """ 4 | filegroup( 5 | name = "files", 6 | srcs = glob(["**/*"]), 7 | visibility = ["//visibility:public"], 8 | ) 9 | """ 10 | 11 | DEFAULT_GITHUB_HOST = "github.com" 12 | 13 | def github_hugo_theme(name, owner, repo, commit, github_host=DEFAULT_GITHUB_HOST, **kwargs): 14 | 15 | url = "https://{github_host}/{owner}/{repo}/archive/{commit}.zip".format( 16 | owner = owner, 17 | repo = repo, 18 | commit = commit, 19 | github_host = github_host, 20 | ) 21 | strip_prefix = "{repo}-{commit}".format( 22 | repo = repo, 23 | commit = commit, 24 | ) 25 | if "build_file" in kwargs or "build_file_content" in kwargs: 26 | http_archive( 27 | name = name, 28 | url = url, 29 | strip_prefix = strip_prefix, 30 | **kwargs 31 | ) 32 | else: 33 | http_archive( 34 | name = name, 35 | url = url, 36 | strip_prefix = strip_prefix, 37 | build_file_content = DEFAULT_BUILD_FILE, 38 | **kwargs 39 | ) 40 | -------------------------------------------------------------------------------- /site_complex/config/_default/params.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | --- 15 | description: > 16 | This is a more complex example, using multi-language configuration for open source docs. 17 | images: 18 | - "socialmedia2.png" 19 | 20 | geekdocToC: 3 21 | geekdocTagsToMenu: true 22 | 23 | #geekdocRepo: https://github.com/thegeeklab/hugo-geekdoc 24 | #geekdocEditPath: edit/main/exampleSite 25 | 26 | geekdocSearch: true 27 | geekdocSearchShowParent: true 28 | 29 | #geekdocLegalNotice: https://thegeeklab.de/legal-notice/#contact-information 30 | #geekdocPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy 31 | 32 | geekdocImageLazyLoading: true 33 | geekdocDarkModeDim: true -------------------------------------------------------------------------------- /site_complex/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_site", "hugo_theme", "hugo_serve") 16 | 17 | hugo_theme( 18 | name = "hugo_theme_geekdoc", 19 | theme_name = "hugo-geekdoc", 20 | srcs = [ 21 | "@com_github_thegeeklab_hugo_geekdoc//:files", 22 | ], 23 | ) 24 | 25 | hugo_site( 26 | name = "site_complex", 27 | config_dir = glob(["config/**"]), 28 | content = glob(["content/**"]), 29 | data = glob(["data/**"]), 30 | quiet = False, 31 | theme = ":hugo_theme_geekdoc", 32 | verbose = True, 33 | ) 34 | 35 | # Run local development server 36 | hugo_serve( 37 | name = "serve", 38 | dep = [":site_complex"], 39 | ) 40 | -------------------------------------------------------------------------------- /site_complex/config/_default/config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | --- 16 | baseURL: http://localhost:1313 17 | title: Complex Site 18 | theme: hugo-geekdoc 19 | 20 | pygmentsUseClasses: true 21 | pygmentsCodeFences: true 22 | timeout: 180000 23 | pluralizeListTitles: false 24 | 25 | defaultContentLanguage: en 26 | 27 | disablePathToLower: true 28 | enableGitInfo: false 29 | 30 | enableRobotsTXT: true 31 | 32 | markup: 33 | goldmark: 34 | renderer: 35 | unsafe: true 36 | tableOfContents: 37 | startLevel: 1 38 | endLevel: 9 39 | 40 | taxonomies: 41 | tag: tags 42 | 43 | outputs: 44 | home: 45 | - HTML 46 | page: 47 | - HTML 48 | section: 49 | - HTML 50 | taxonomy: 51 | - HTML 52 | term: 53 | - HTML 54 | 55 | security: 56 | exec: 57 | allow: 58 | - "^asciidoctor$" 59 | 60 | -------------------------------------------------------------------------------- /site_simple/content/docs/proto.md: -------------------------------------------------------------------------------- 1 | # proto.stack.build 2 | 3 | is a hosted protobuf/gRPC build service that allows 4 | organization to generate protobuf assets in multiple languages without the 5 | typical hassle. 6 | 7 | 8 | {{< columns >}} 9 | ## Protobuf 10 | 11 | 13 | 14 | Language- and platform-neutral, efficient, extensible, automated mechanism for 15 | serializing structured data for use in communications protocols 16 | 17 | 18 | <---> 19 | 20 | ## gRPC 21 | 22 | 24 | 25 | Modern, high-performance, open-source and universal remote procedure call (RPC) 26 | framework that can run anywhere. It enables client and server applications to 27 | communicate transparently and makes it easier to build connected systems. 28 | 29 | {{< /columns >}} 30 | 31 | ## Problem 32 | 33 | Protobuf is a transformative serialization and RPC technology but it remains 34 | challenging to assemble the correct plugins and output assets in multiple languages. 35 | 36 | ## Solution 37 | 38 | **proto.stack.build** will provide an easy way for organizations to generate 39 | release assets for protobuf api repositories. 40 | 41 | ## Status 42 | 43 | Planned public release **Q2/Q3 2019** -------------------------------------------------------------------------------- /hugo/internal/hugo_repository.bzl: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 2 | 3 | HUGO_BUILD_FILE = """ 4 | package(default_visibility = ["//visibility:public"]) 5 | exports_files( ["hugo"] ) 6 | """ 7 | 8 | def _hugo_repository_impl(repository_ctx): 9 | hugo = "hugo" 10 | if repository_ctx.attr.extended: 11 | hugo = "hugo_extended" 12 | 13 | os_arch = repository_ctx.attr.os_arch 14 | 15 | os_name = repository_ctx.os.name.lower() 16 | if os_name.startswith("mac os"): 17 | os_arch = "macOS-64bit" 18 | elif os_name.find("windows") != -1: 19 | os_arch = "Windows-64bit" 20 | else: 21 | os_arch = "Linux-64bit" 22 | 23 | url = "https://github.com/gohugoio/hugo/releases/download/v{version}/{hugo}_{version}_{os_arch}.tar.gz".format( 24 | hugo = hugo, 25 | os_arch = os_arch, 26 | version = repository_ctx.attr.version, 27 | ) 28 | 29 | repository_ctx.download_and_extract( 30 | url = url, 31 | sha256 = repository_ctx.attr.sha256, 32 | ) 33 | 34 | repository_ctx.file("BUILD.bazel", HUGO_BUILD_FILE) 35 | 36 | hugo_repository = repository_rule( 37 | _hugo_repository_impl, 38 | attrs = { 39 | "version": attr.string( 40 | default = "0.55.5", 41 | doc = "The hugo version to use", 42 | ), 43 | "sha256": attr.string( 44 | doc = "The sha256 value for the binary", 45 | ), 46 | "os_arch": attr.string( 47 | doc = "The os arch value. If empty, autodetect it", 48 | ), 49 | "extended": attr.bool( 50 | doc = "Use extended hugo version", 51 | ), 52 | }, 53 | ) 54 | -------------------------------------------------------------------------------- /site_simple/config.yaml: -------------------------------------------------------------------------------- 1 | # hugo server --minify --themesDir ... --baseURL=http://0.0.0.0:1313/example 2 | 3 | # baseURL: https://rules_hugo.github.com/ 4 | baseURL: / 5 | title: stackb/rules_hugo 6 | theme: book 7 | disableKinds: ['taxonomy', 'taxonomyTerm'] 8 | # themesDir: ../.. 9 | 10 | # Book configuration 11 | disablePathToLower: true 12 | enableGitInfo: false 13 | 14 | # Code highlight 15 | # pygmentsStyle: monokailight 16 | pygmentsCodeFences: true 17 | 18 | params: 19 | # (Optional, default 6) Set how many table of contents levels to be showed on page. 20 | # Use false/off to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/) 21 | # You can also specify this parameter per page in front matter 22 | BookToC: 3 23 | 24 | # (Optional, default none) Set leaf bundle to render as side menu 25 | # When not specified file structure and weights will be used 26 | BookMenuBundle: /menu 27 | 28 | # (Optional, default docs) Specify section of content to render as menu 29 | # You can also set value to '*' to render all sections to menu 30 | BookSection: docs 31 | 32 | # This value is duplicate of $link-color for making active link highlight in menu bundle mode 33 | # BookMenuBundleActiveLinkColor: \#004ed0 34 | 35 | # Include JS scripts in pages. Disabled by default. 36 | # - Keep side menu on same scroll position during navigation 37 | BookEnableJS: true 38 | 39 | # Set source repository location. 40 | # Used for 'Last Modified' and 'Edit this page' links. 41 | BookRepo: https://github.com/stackb/rules_hugo 42 | 43 | # Enable "Edit this page" links for 'doc' page type. 44 | # Disabled by default. Uncomment to enable. Requires 'BookRepo' param. 45 | # Path must point to 'content' directory of repo. 46 | # BookEditPath: edit/master/site/content 47 | 48 | # Configure the date format used on the pages 49 | # - In git information 50 | # - In blog posts 51 | BookDateFormat: 'Jan 2, 2006' 52 | -------------------------------------------------------------------------------- /site_simple/content/docs/hidden.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookHidden: true 3 | --- 4 | 5 | # This page is hidden in menu 6 | 7 | # Quondam non pater est dignior ille Eurotas 8 | 9 | ## Latent te facies 10 | 11 | Lorem markdownum arma ignoscas vocavit quoque ille texit mandata mentis ultimus, 12 | frementes, qui in vel. Hippotades Peleus [pennas 13 | conscia](http://gratia.net/tot-qua.php) cuiquam Caeneus quas. 14 | 15 | - Pater demittere evincitque reddunt 16 | - Maxime adhuc pressit huc Danaas quid freta 17 | - Soror ego 18 | - Luctus linguam saxa ultroque prior Tatiumque inquit 19 | - Saepe liquitur subita superata dederat Anius sudor 20 | 21 | ## Cum honorum Latona 22 | 23 | O fallor [in sustinui 24 | iussorum](http://www.spectataharundine.org/aquas-relinquit.html) equidem. 25 | Nymphae operi oris alii fronde parens dumque, in auro ait mox ingenti proxima 26 | iamdudum maius? 27 | 28 | reality(burnDocking(apache_nanometer), 29 | pad.property_data_programming.sectorBrowserPpga(dataMask, 37, 30 | recycleRup)); 31 | intellectualVaporwareUser += -5 * 4; 32 | traceroute_key_upnp /= lag_optical(android.smb(thyristorTftp)); 33 | surge_host_golden = mca_compact_device(dual_dpi_opengl, 33, 34 | commerce_add_ppc); 35 | if (lun_ipv) { 36 | verticalExtranet(1, thumbnail_ttl, 3); 37 | bar_graphics_jpeg(chipset - sector_xmp_beta); 38 | } 39 | 40 | ## Fronde cetera dextrae sequens pennis voce muneris 41 | 42 | Acta cretus diem restet utque; move integer, oscula non inspirat, noctisque 43 | scelus! Nantemque in suas vobis quamvis, et labori! 44 | 45 | var runtimeDiskCompiler = home - array_ad_software; 46 | if (internic > disk) { 47 | emoticonLockCron += 37 + bps - 4; 48 | wan_ansi_honeypot.cardGigaflops = artificialStorageCgi; 49 | simplex -= downloadAccess; 50 | } 51 | var volumeHardeningAndroid = pixel + tftp + onProcessorUnmount; 52 | sector(memory(firewire + interlaced, wired)); -------------------------------------------------------------------------------- /site_simple/content/docs/sub-section/_index.md: -------------------------------------------------------------------------------- 1 | # Fida abluere audiat moram ferarum terram virgae 2 | 3 | ## Facere fluidove ab naides ut sic cornu 4 | 5 | Lorem markdownum Lucifer est, ire tangit inposito terram. Ore et pes lavet nuper 6 | longam, longa sub, erat nec Lemnicolae, in. 7 | [Et](http://sumparvi.org/ossaquerecludit) nec tantaque sollicitive cognovi et ut 8 | videbar verso **passis**, Epimethida tutos. Dedecus Desine morae. 9 | 10 | Fervens esse et tenet cinisque per: et vir equus formaque superorum tollit, 11 | vires meae magnum; Latona. Fundamine potitur genialis: imagine gaudet et herba 12 | rura vates horrendum, laborum quis: potero aureus habitantque illos nox? E 13 | factorum breve ad in verum Euboea templis volitat pompa aureus pallebant 14 | videres, replet inque color? Capit et bipennem Finis sonuere magno nec pennis 15 | exhortatur tenebat, ait. 16 | 17 | ## Gurgite caede Hippocoon auxilio furit 18 | 19 | Freta amatos. [Saxum](http://horas-pericula.net/inprudens.php) vocanti Iovem sui 20 | quicquam viro linguae minus, ara nec tu ipsa ars miserae, quam tetigit vacet 21 | inque. Fuistis Deucalion, populi invidiae *indicat texere est* Helicon simul. 22 | 23 | 1. Hominum quantaque membra duos 24 | 2. Domum tela 25 | 3. Totus penna 26 | 4. Charaxi cogitis Hoc caelo est removit Anubis 27 | 5. Simulacra Delo posset insula 28 | 6. Infelix et nox fixa adhuc 29 | 30 | ## Trabes per coercet mittere toro 31 | 32 | Cerae movit: patria quid, Alpheias **magicaeque** puer! Cum venit quidem, sors 33 | erigor coniunctis sparsa carpe periuria in vultu temperat gradibus. Tutus 34 | fecimus, caput; flamma mentis retia fuit Pallas. 35 | 36 | > Arbore et agitasse partes patrem dumque ab, nec infans, sollemnia summis 37 | > resque, de malles ille? Ultor fugaverat nemus, quaerenti nolle coniugis 38 | > manibus contraque pace. Fuit verba ipse ignavi vulnus. Nam illud *inferius* 39 | > iuvenale iuncta tandem. 40 | 41 | Deus hostia Peneidas ad passu in venerat postes 42 | [nymphae](http://ullo-herbae.org/). Sagittis tabo sibi marmoreum. -------------------------------------------------------------------------------- /site_simple/content/docs/chrystl.md: -------------------------------------------------------------------------------- 1 | 2 | # Chrystl 3 | 4 | Chrystl (pronounced as "*crystal*") is a user-interface for the bazel build tool. 5 | 6 | 8 | 9 | ## Problem 10 | 11 | While Bazel is an excellent build tool, it can be **challenging to learn**. 12 | Bazel has a reputation for being **opaque** to what the build "*looks like*" and 13 | what is happening "*under the hood*". 14 | 15 | ## Solution 16 | 17 | Chrystl **provides clarity** for your build and can **ease the adoption of bazel 18 | within the enterprise**. 19 | 20 | Chrystl is designed to: 21 | 22 | - **Onboard faster**; ease the transition for new bazel developers 23 | - **Provide a shared understanding** from all members/roles of the development team 24 | - **Debug issues easier** with actions/sandboxing & remote execution 25 | - **Search easily** for rules / files within the build 26 | - **Serve generated assets** from the build directly 27 | 28 | ## Pricing 29 | 30 | Individual develop licenses are available for **$129/user/year**. Enterprise 31 | agreements / volume pricing are available on request. 32 | 33 | Purchase comes with a two week "no-questions-asked" refund policy. 34 | 35 | ## Download 36 | 37 | Please [contact us](email:pcj@stack.build) for download instructions. 38 | 39 | ## Screenshots 40 | 41 | Workspace package structure: 42 | 43 | 45 | 46 | Build Rule: 47 | 48 | 50 | 51 | Flag Browser: 52 | 53 | 55 | -------------------------------------------------------------------------------- /site_simple/content/docs/open-source.md: -------------------------------------------------------------------------------- 1 | # Open-source Projects 2 | 3 | Stack.Build loves open source! Here are some selected projects: 4 | 5 | {{< columns >}} 6 | ## [rules_proto](https://github.com/stackb/rules_proto) 7 | 8 | 10 | 11 | Bazel build rules for protobuf in numerous languages. 12 | 13 | <---> 14 | 15 | ## [rules_hugo](https://github.com/stackb/rules_hugo) 16 | 17 | 19 | 20 | Bazel build rules for hugo static site generation. 21 | 22 | {{< /columns >}} 23 | 24 | 25 | ``` 26 | 27 | ``` 28 | 29 | 30 | {{< columns >}} 31 | ## [grpc.js](https://github.com/stackb/grpc.js) 32 | 33 | 34 | 36 | 37 | Closure javascript implementation of the [grpc-web]() protocol. 38 | 39 | <---> 40 | 41 | ## [buildkube](https://github.com/stackb/https://github.com/stackb/buildkube) 42 | 43 | 45 | 46 | Deploy bazel remote execution systems in Kubernetes. 47 | 48 | {{< /columns >}} 49 | 50 | 51 | ``` 52 | 53 | ``` 54 | 55 | 56 | {{< columns >}} 57 | ## [starlark-go-nethttp](https://github.com/pcj/starlark-go-nethttp) 58 | 59 | 61 | 62 | Starlark http module for the [starlark-go](https://github.com/google/starlark-go) language implementation. 63 | 64 | <---> 65 | 66 | ## [google-options](https://github.com/pcj/google-options) 67 | 68 | 69 | 71 | 72 | Java options parsing library from Bazel 73 | 74 | {{< /columns >}} 75 | 76 | 77 | -------------------------------------------------------------------------------- /site_simple/content/docs/contact.md: -------------------------------------------------------------------------------- 1 | # Ista qua aera 2 | 3 | ## Tetigisse hac duc omnipotens urbis per sapiente 4 | 5 | Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat 6 | stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa 7 | protulit, sed sed aere valvis inhaesuro Pallas animam: qui *quid*, ignes. 8 | Miseratus fonte Ditis conubia. 9 | 10 | var mnemonicPcmcia = file; 11 | if (bookmarkMultiprocessing) { 12 | core.intranetDigitize = menu(vdslWordart(enterprise, 13 | dviRealityTeraflops)); 14 | } else { 15 | portal_socket.jsp_shareware_digital = multicasting(component_uml); 16 | memory.ppc_title_hit(lunWebFormat + fontSmartphoneView, tween * 17 | default_hard, 5 + laptopMethod); 18 | wddm_tablet_null.widgetFileRate(3, leakMaskResponsive); 19 | } 20 | var siteRjSoftware = installer; 21 | html.text = address + nasSystemDns; 22 | 23 | ## Lac roratis Diomede 24 | 25 | *Aut in vivitur* quam ibi is veniebat Herculis mihi hominem! In matrem gesserit 26 | manus [coniuge silva](http://etinachus.org/cornibusalter.html) pectore simul nec 27 | felix in haud ostendit lacrimavit mora. Digna adspice temptata, Palaestina armis 28 | at crura centum tellus ni tibi Amphiona mansit, bello tibi pugnat fuit. Sidera 29 | nec ambo temporis summe tempore, falsa committere, pater horrenda, erat ast 30 | cadunt preces. 31 | 32 | 1. Ventorum pariturae cum discors fit dabat inguina 33 | 2. Armeniae viscera 34 | 3. Et monitusque boum misereri 35 | 4. Obliquaque primasque suae 36 | 37 | ## Ovaque in tendens tibi Iovis iuga 38 | 39 | Vagatur laboribus vocandus [honorque segnior 40 | inclinat](http://www.neve-tellus.io/) petentes manere ut terram fundit; sunt. 41 | Pressit eodem inmotae quasque linguam, sub famem animos dei nocte futura 42 | Laconide India. Posset iter nata negarit *limina latus postquam* serior, cum dic 43 | area iamdudum non! Et curaque [me illo](http://testudine-est.com/): addidit 44 | tuam, Cerealia, fila undae Ilithyiam proceresque tegens numero dominaeque 45 | **regna** humanis. Multo [adstringit hirsutaque](http://www.e.org/est.php) 46 | crimine postquam perfudit illis, a mutua, memorant. 47 | 48 | ## His nocte ipse cum oculorum recepta ignorat 49 | 50 | Minos ad carmina exire studiosior Talia tamen, est a hi de quae ipsa et quoniam. 51 | Se victus at unca tantae eurus Euippe Bacchumque vocantia. 52 | 53 | Ullum frena statione de at praeferret classi Acarnanum iacuit lacertis gemino; 54 | ad caperet **finiat**! Utque videt ingemuit Dulichium paravi portaque te et, tot 55 | ab caesariem sumit, vias in rerum te. -------------------------------------------------------------------------------- /site_simple/content/docs/about.md: -------------------------------------------------------------------------------- 1 | # Vagus elidunt 2 | 3 | ## Mole et vultus populifer quaque primoque non 4 | 5 | Lorem **markdownum pignora pelle** est tota propiore conpellat pectoribus de 6 | pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice 7 | subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc 8 | caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis 9 | lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. 10 | 11 | 1. Exierant elisi ambit vivere dedere 12 | 2. Duce pollice 13 | 3. Eris modo 14 | 4. Spargitque ferrea quos palude 15 | 16 | Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus 17 | silentia flumen, sustinet placuit petis in dilapsa erat sunt. [Atria 18 | tractus](http://agendo-dis.io/) malis. 19 | 20 | 1. Comas hunc haec pietate fetum procerum dixit 21 | 2. Post torum vates letum Tiresia 22 | 3. Flumen querellas 23 | 4. Arcanaque montibus omnes 24 | 5. Quidem et 25 | 26 | ## Mane refeci capiebant unda mulcebat 27 | 28 | Victa caducifer, [malo vulnere](http://www.nec.org/iactorcolonos.php) contra 29 | dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere 30 | furit nec; iaculi [matertera](http://iugis-thalamique.com/pecus) et visa est, 31 | viribus. Divesque creatis, tecta novat collumque vulnus 32 | [est](http://canentiet.net/lateri.php), parvas. **Faces illo pepulere** tempus 33 | adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. 34 | 35 | var multiplatform = cifs(illegal, zip, memory) / pcbPowerJavascript; 36 | hdmi -= 3; 37 | tunneling(constant(service_fi_hyper, avatarBar), matrixUmlMbps); 38 | frequency /= nat(keyboardRecycle, programmingGnuPerl) + icfExbibyteCursor; 39 | io_dithering(-5, markup / languageShortcut - driveHtml); 40 | 41 | Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli 42 | Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare 43 | Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert 44 | ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae 45 | vulnus haerentia iuste et exercebat, sui et. 46 | 47 | Eurytus Hector, [materna](http://mandereevincitque.net/), ipsumque ut Politen, 48 | nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, 49 | inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. 50 | Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a 51 | alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem 52 | Propoetides **parte**. -------------------------------------------------------------------------------- /site_simple/content/docs/sub-section/natusque.md: -------------------------------------------------------------------------------- 1 | # Natusque putat tu vero 2 | 3 | ## Scylaceaque neve coepisse 4 | 5 | Lorem markdownum hostem et addit arbusta iacuit laetissimus medio, quae quoque 6 | faciente. Belli et fuerant fuerat, curas Abas equos sacerdos iactasque videndo 7 | tanto, sub. Et simulasse caedis, est nec acre addiderat, manet Phrygiae 8 | quisquam, ater, aura sua **deique cornua**. Bacchi *dixi* cum tollit, ad 9 | sinistra mirum, non se dis fraudare in decimo vocet. Ducunt **Acrisio sine 10 | ratem**: enim illas venti, ferit nam ora. 11 | 12 | > Crescente cernis ritusque et vertice potui, fugam conferat enim, quin te Iuno, 13 | > Calydonia! Cursum est suo lassant quam cutis virgo urbe illa auras, finem. 14 | > [Trabem est](http://www.tutus.io/) secedere Bybli laudant quercus tribuitque 15 | > relinque et cornua ora, et quoniam maledicere viscera caelobracchia omne hoc. 16 | > Metaque Arcas patet *intraverat tenet*. 17 | 18 | Silvisque primae tulisset sive sonuere, incola visa veniat temptantes spernimur 19 | et dictis se. Sub gerunt. Aqua [tantum templi](http://www.dextra.net/) 20 | peregrinis ut *aevo cuique* falsi, ibat avidae transitus. 21 | 22 | ## Modo auctor imbres est 23 | 24 | Clanis cernere monstravit illic quoque, in ignis male una deme? Alta sonanti 25 | relatus Pindo: nisi Pico edidit data tamen rurigenae avoque. Quotiens vela petis 26 | inposuit et parte utque, tempus pars contendere facturus tumidus. Flores 27 | culpavit fera retinens, vita puer publica ferebat positas. 28 | 29 | if (mashupTopologyMnemonic(70) >= domain_correction_schema) { 30 | romTeraflops = log_android; 31 | mms_vrml_alignment(keyboard, oop, computerCodec); 32 | } 33 | retina_samba_arp *= desktop_itunes_mainframe(leopard, 511935) * 88 / 34 | direct_excel(-3, infringement_bespoke_apache, cmyk); 35 | drivePowerPlay.registryAix += dma; 36 | text_data.upsOdbc = error(user(processor_token_forum) * art_ajax_ldap); 37 | 38 | Patriaque volvitur scire Naryciusque iuvenem dixit adfusique bicorni cupido. 39 | Tecumque corpore sublato, mox hostibus et muneris, non. Draconum noscit dapibus 40 | scopulis spondere lupum diro, illo ille victoque cibis; umentia spes. 41 | 42 | Alumno est postquam gracili adnuimusque ore est praemia, ulla patitur: te disce 43 | erat cruribus prosunt. Arboris illis neque, et erubuit Gallicus: iam remisit 44 | adimuntque adsuerat nolit attonitus! Torvamque sensi ut fecundo fortuna bracchia 45 | fuerant, semper de manet inseris. 46 | 47 | Ictibus in cursus in, in isque Polyxena et Solis oris pressa exclamat *in tori* 48 | lactente. [Locoque](http://est.net/et.html) iam fata Stygia lege transire. -------------------------------------------------------------------------------- /site_simple/content/docs/without-toc.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookShowToc: false 3 | --- 4 | 5 | # At me ipso nepotibus nunc celebratior genus 6 | 7 | ## Tanto oblite 8 | 9 | Lorem markdownum pectora novis patenti igne sua opus aurae feras materiaque 10 | illic demersit imago et aristas questaque posset. Vomit quoque suo inhaesuro 11 | clara. Esse cumque, per referri triste. Ut exponit solisque communis in tendens 12 | vincetis agisque iamque huic bene ante vetat omina Thebae rates. Aeacus servat 13 | admonitu concidit, ad resimas vultus et rugas vultu **dignamque** Siphnon. 14 | 15 | Quam iugulum regia simulacra, plus meruit humo pecorumque haesit, ab discedunt 16 | dixit: ritu pharetramque. Exul Laurenti orantem modo, per densum missisque labor 17 | manibus non colla unum, obiectat. Tu pervia collo, fessus quae Cretenque Myconon 18 | crate! Tegumenque quae invisi sudore per vocari quaque plus ventis fluidos. Nodo 19 | perque, fugisse pectora sorores. 20 | 21 | ## Summe promissa supple vadit lenius 22 | 23 | Quibus largis latebris aethera versato est, ait sentiat faciemque. Aequata alis 24 | nec Caeneus exululat inclite corpus est, ire **tibi** ostendens et tibi. Rigent 25 | et vires dique possent lumina; **eadem** dixit poma funeribus paret et felix 26 | reddebant ventis utile lignum. 27 | 28 | 1. Remansit notam Stygia feroxque 29 | 2. Et dabit materna 30 | 3. Vipereas Phrygiaeque umbram sollicito cruore conlucere suus 31 | 4. Quarum Elis corniger 32 | 5. Nec ieiunia dixit 33 | 34 | Vertitur mos ortu ramosam contudit dumque; placabat ac lumen. Coniunx Amoris 35 | spatium poenamque cavernis Thebae Pleiadasque ponunt, rapiare cum quae parum 36 | nimium rima. 37 | 38 | ## Quidem resupinus inducto solebat una facinus quae 39 | 40 | Credulitas iniqua praepetibus paruit prospexit, voce poena, sub rupit sinuatur, 41 | quin suum ventorumque arcadiae priori. Soporiferam erat formamque, fecit, 42 | invergens, nymphae mutat fessas ait finge. 43 | 44 | 1. Baculum mandataque ne addere capiti violentior 45 | 2. Altera duas quam hoc ille tenues inquit 46 | 3. Sicula sidereus latrantis domoque ratae polluit comites 47 | 4. Possit oro clausura namque se nunc iuvenisque 48 | 5. Faciem posuit 49 | 6. Quodque cum ponunt novercae nata vestrae aratra 50 | 51 | Ite extrema Phrygiis, patre dentibus, tonso perculit, enim blanda, manibus fide 52 | quos caput armis, posse! Nocendo fas Alcyonae lacertis structa ferarum manus 53 | fulmen dubius, saxa caelum effuge extremis fixum tumor adfecit **bella**, 54 | potentes? Dum nec insidiosa tempora tegit 55 | [spirarunt](http://mihiferre.net/iuvenes-peto.html). Per lupi pars foliis, 56 | porreximus humum negant sunt subposuere Sidone steterant auro. Memoraverit sine: 57 | ferrum idem Orion caelum heres gerebat fixis? -------------------------------------------------------------------------------- /site_simple/content/docs/sub-section/ego-numen.md: -------------------------------------------------------------------------------- 1 | # Ego numen obest 2 | 3 | ## Mors curru Iove pedibus curva humano salutem 4 | 5 | Lorem markdownum, mole, profugus. Madida ne quantus, pars verba lacrimis 6 | memorique longius cupidi ipse attrahit et. Vota liberiore rector suos fallit 7 | videor iustissimus barbara quod habet. Tantum patriaeque *omnia spectes* inimica 8 | mari nec spemque ululare: nuper quodque, sic, quo. 9 | 10 | var php_wireless = 4; 11 | siteWinsock.switch_inbox += so_control_logic; 12 | if (target_website.bugCopyrightIcs.cms_digital_method(mca_active) > 13 | cloneScrollHttps) { 14 | https_drop_hard(97, sshPayload + autoresponder_bmp_file); 15 | hypertextCommercialBookmark = optical_impact; 16 | } 17 | architecture = userRate.unfriend(petabyteFile(irc, wave, 18 | logic_tag.impact.cookie_favorites(5, 83)), listserv, malware_cad( 19 | disk)); 20 | 21 | Populi annum deprendere suae recumbis in sedem starent! Super non accedat 22 | percepitque negare inconcessisque habitare: puerum: picta. Haec natamque, in 23 | rubentem auctore quantas oetaeas **certamine** levatae sollicitumque mecum vultu 24 | obstructaque. Limina subtemen qui trepidare virgine! Enim rumor paenituit haec 25 | **crimine Melampus** sidus. 26 | 27 | ## Partem robora herbae ilice hic exspectatus tepidique 28 | 29 | Heu fugit carne, illo ex Iunonis ut tempora sacrata, adhaesi. Fallunt eque 30 | amnes! 31 | 32 | 1. Vile ille res sidera gaudebat felicia auxilium 33 | 2. Sacra curam adfusique vasti progenitore omnia nutantem 34 | 3. Quod notum spesque extentam fores in voces 35 | 4. In qualia aequo 36 | 5. Auro commoda 37 | 6. Mearum huic volucres locorum formosus 38 | 39 | ## Invidiae fidemque cogamque esset potentia Minos 40 | 41 | Sub silicem, semesaque nec, pone pariterque tendentem, in pactae suarum recurvas 42 | et contra tu minister via. Subducere tangeris neque coniunxque utque. Virga 43 | altam, mortemque: **ubi** procul, et vidi committit. Et 44 | [Alpheos](http://nivea-pavens.io/ferroclara.html)! Perfide age magna per aequor 45 | abstulerat, Boeotia sentit succincta ad linquit confugisse certae, de dignatur 46 | et! 47 | 48 | > Sic nacta saxo *crura*, iustis rorantia premens tempora lecte sumpsisse 49 | > nusquam ulvam, apta! Sed sub plumas consueta quae; tibi mihi nec committi 50 | > mundi? 51 | 52 | Ipsa dea serpentum illic; aspicit reticere Aeaciden mitto; est novis exul. 53 | Invidit senior vela, cava sed plumae vident ille ipse domo litus ac fallere 54 | lumina, nisi famem cycno. 55 | 56 | Nunc miserata admisitque [nata](http://mollibus.net/secessitnostrique), cum 57 | loco, **iacerent**, te medullas matres. Fraude tamen, prorumpit puerum primo 58 | polus regalia pampineis iungunt nec, aderis replent carituraque cervus. 59 | Primusque lapides ad inpia pedibus; non fare praeterit penetralia in pedum uror. 60 | Rapitur vivis lacrimis, vena et *dixit*. -------------------------------------------------------------------------------- /site_simple/content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | type: docs 4 | --- 5 | 6 | # Bazel Rules for Hugo Static Site Generator 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
RulesHugo
15 | 16 | ## Add Workspace Dependencies 17 | 18 | Declare a dependency on `build_stack_rules_hugo` in your `WORKSPACE`: 19 | 20 | ```python 21 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 22 | 23 | http_archive( 24 | name = "build_stack_rules_hugo", 25 | urls = ["https://github.com/stackb/rules_hugo/archive/6bca4c2786a54d7d7acfa76cd51b0a6370bd91c4.tar.gz"], 26 | strip_prefix = "rules_hugo-6bca4c2786a54d7d7acfa76cd51b0a6370bd91c4", 27 | sha256 = "7d2fe8b2ba4e6e662c79c1503890c2eb82d5717a411bb6fd805269758da40c9a", 28 | ) 29 | ``` 30 | 31 | Declare a dependency on the hugo binary as well as a theme in your `WORKSPACE`: 32 | 33 | ```python 34 | load("@build_stack_rules_hugo//hugo:rules.bzl", "github_hugo_theme", "hugo_repository") 35 | 36 | hugo_repository( 37 | name = "hugo", 38 | extended = True, 39 | ) 40 | 41 | github_hugo_theme( 42 | name = "com_github_alex_shpak_hugo_book", 43 | commit = "07048f7bf5097435a05c1e8b77241b0e478023c2", 44 | owner = "alex-shpak", 45 | repo = "hugo-book", 46 | ) 47 | ``` 48 | 49 | ## Add Theme Files 50 | 51 | Copy the site template files into your repository. Typically themes include an 52 | `exampleSite`, so one way to do this is: 53 | 54 | ```sh 55 | $ bazel fetch @com_github_alex_shpak_hugo_book//:files 56 | $ cp $(bazel info output_base)/external/com_github_alex_shpak_hugo_book/exampleSite/ ./site 57 | ``` 58 | 59 | ## Build Rules 60 | 61 | Create a build file for the site: 62 | 63 | ```sh 64 | $ touch site/BUILD.bazel 65 | ``` 66 | 67 | Having the following rules: 68 | 69 | ```python 70 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_site", "hugo_theme") 71 | 72 | hugo_theme( 73 | name = "book", 74 | srcs = [ 75 | "@com_github_alex_shpak_hugo_book//:files", 76 | ], 77 | ) 78 | 79 | hugo_site( 80 | name = "site", 81 | config = "config.yaml", 82 | content = glob(["content/**"]), 83 | static = glob(["static/**"]), 84 | layouts = glob(["layouts/**"]), 85 | theme = ":book", 86 | ) 87 | ``` 88 | 89 | ## Generate 90 | 91 | To build the site: 92 | 93 | ```sh 94 | $ bazel build //site 95 | ``` 96 | 97 | Locally serve site: 98 | 99 | ```sh 100 | $ (cd $(shell bazel info bazel-bin)/site/site && python -m SimpleHTTPServer 7070) 101 | ``` 102 | 103 | Create a tarball: 104 | 105 | ```sh 106 | $ tar -cvf bazel-out/site.tar -C $(shell bazel info bazel-bin)/site/site . 107 | ``` 108 | 109 | ## End 110 | 111 | Have fun! 112 | -------------------------------------------------------------------------------- /site_simple/content/docs/with-toc.md: -------------------------------------------------------------------------------- 1 | # Caput vino delphine in tamen vias 2 | 3 | ## Cognita laeva illo fracta 4 | 5 | Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que** 6 | est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit 7 | aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et 8 | callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite 9 | [famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si 10 | frondes *gelidos* gravidae circumtulit [inpulit armenta 11 | nativum](http://incurvasustulit.io/illi-virtute.html). 12 | 13 | 1. Te at cruciabere vides rubentis manebo 14 | 2. Maturuit in praetemptat ruborem ignara postquam habitasse 15 | 3. Subitarum supplevit quoque fontesque venabula spretis modo 16 | 4. Montis tot est mali quasque gravis 17 | 5. Quinquennem domus arsit ipse 18 | 6. Pellem turis pugnabant locavit 19 | 20 | ## Natus quaerere 21 | 22 | Pectora et sine mulcere, coniuge dum tincta incurvae. Quis iam; est dextra 23 | Peneosque, metuis a verba, primo. Illa sed colloque suis: magno: gramen, aera 24 | excutiunt concipit. 25 | 26 | > Phrygiae petendo suisque extimuit, super, pars quod audet! Turba negarem. 27 | > Fuerat attonitus; et dextra retinet sidera ulnas undas instimulat vacuae 28 | > generis? *Agnus* dabat et ignotis dextera, sic tibi pacis **feriente at mora** 29 | > euhoeque *comites hostem* vestras Phineus. Vultuque sanguine dominoque [metuit 30 | > risi](http://iuvat.org/eundem.php) fama vergit summaque meus clarissimus 31 | > artesque tinguebat successor nominis cervice caelicolae. 32 | 33 | ## Limitibus misere sit 34 | 35 | Aurea non fata repertis praerupit feruntur simul, meae hosti lentaque *citius 36 | levibus*, cum sede dixit, Phaethon texta. *Albentibus summos* multifidasque 37 | iungitur loquendi an pectore, mihi ursaque omnia adfata, aeno parvumque in animi 38 | perlucentes. Epytus agis ait vixque clamat ornum adversam spondet, quid sceptra 39 | ipsum **est**. Reseret nec; saeva suo passu debentia linguam terga et aures et 40 | cervix [de](http://www.amnem.io/pervenit.aspx) ubera. Coercet gelidumque manus, 41 | doluit volvitur induta? 42 | 43 | ## Enim sua 44 | 45 | Iuvenilior filia inlustre templa quidem herbis permittat trahens huic. In 46 | cruribus proceres sole crescitque *fata*, quos quos; merui maris se non tamen 47 | in, mea. 48 | 49 | ## Germana aves pignus tecta 50 | 51 | Mortalia rudibusque caelum cognosceret tantum aquis redito felicior texit, nec, 52 | aris parvo acre. Me parum contulerant multi tenentem, gratissime suis; vultum tu 53 | occupat deficeret corpora, sonum. E Actaea inplevit Phinea concepit nomenque 54 | potest sanguine captam nulla et, in duxisses campis non; mercede. Dicere cur 55 | Leucothoen obitum? 56 | 57 | Postibus mittam est *nubibus principium pluma*, exsecratur facta et. Iunge 58 | Mnemonidas pallamque pars; vere restitit alis flumina quae **quoque**, est 59 | ignara infestus Pyrrha. Di ducis terris maculatum At sede praemia manes 60 | nullaque! -------------------------------------------------------------------------------- /site_simple/content/docs/products.md: -------------------------------------------------------------------------------- 1 | # Ubi loqui 2 | 3 | ## Mentem genus facietque salire tempus bracchia 4 | 5 | Lorem markdownum partu paterno Achillem. Habent amne generosi aderant ad pellem 6 | nec erat sustinet merces columque haec et, dixit minus nutrit accipiam subibis 7 | subdidit. Temeraria servatum agros qui sed fulva facta. Primum ultima, dedit, 8 | suo quisque linguae medentes fixo: tum petis. 9 | 10 | ## Rapit vocant si hunc siste adspice 11 | 12 | Ora precari Patraeque Neptunia, dixit Danae [Cithaeron 13 | armaque](http://mersis-an.org/litoristum) maxima in **nati Coniugis** templis 14 | fluidove. Effugit usus nec ingreditur agmen *ac manus* conlato. Nullis vagis 15 | nequiquam vultibus aliquos altera *suum venis* teneas fretum. Armos [remotis 16 | hoc](http://tutum.io/me) sine ferrea iuncta quam! 17 | 18 | ## Locus fuit caecis 19 | 20 | Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae 21 | miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me 22 | ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta. 23 | Intravit quam erat figentem hunc, motus de fontes parvo tempestate. 24 | 25 | iscsi_virus = pitch(json_in_on(eupViral), 26 | northbridge_services_troubleshooting, personal( 27 | firmware_rw.trash_rw_crm.device(interactive_gopher_personal, 28 | software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel, 29 | mips_whitelist_duplex, cpa))); 30 | if (5) { 31 | managementNetwork += dma - boolean; 32 | kilohertz_token = 2; 33 | honeypot_affiliate_ergonomics = fiber; 34 | } 35 | mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet( 36 | analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet), 37 | gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork, 38 | trim_duplex_file), cellTapeDirect, token_tooltip_mashup( 39 | ripcordingMashup))); 40 | module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) + 41 | coreLog.joystick(componentUdpLink), windows_expansion_touchscreen); 42 | bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling( 43 | ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp); 44 | 45 | ## Placabilis coactis nega ingemuit ignoscat nimia non 46 | 47 | Frontis turba. Oculi gravis est Delphice; *inque praedaque* sanguine manu non. 48 | 49 | if (ad_api) { 50 | zif += usb.tiffAvatarRate(subnet, digital_rt) + exploitDrive; 51 | gigaflops(2 - bluetooth, edi_asp_memory.gopher(queryCursor, laptop), 52 | panel_point_firmware); 53 | spyware_bash.statePopApplet = express_netbios_digital( 54 | insertion_troubleshooting.brouter(recordFolderUs), 65); 55 | } 56 | recursionCoreRay = -5; 57 | if (hub == non) { 58 | portBoxVirus = soundWeb(recursive_card(rwTechnologyLeopard), 59 | font_radcab, guidCmsScalable + reciprocalMatrixPim); 60 | left.bug = screenshot; 61 | } else { 62 | tooltipOpacity = raw_process_permalink(webcamFontUser, -1); 63 | executable_router += tape; 64 | } 65 | if (tft) { 66 | bandwidthWeb *= social_page; 67 | } else { 68 | regular += 611883; 69 | thumbnail /= system_lag_keyboard; 70 | } 71 | 72 | ## Caesorum illa tu sentit micat vestes papyriferi 73 | 74 | Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non 75 | regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo; 76 | gestanda nitidi, vero? Dum ne pectoraque testantur. 77 | 78 | Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut 79 | manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus 80 | pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae 81 | iusto! Sedes ante dum superest **extrema**. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `rules_hugo` 2 | 3 | [![Build Status](https://api.cirrus-ci.com/github/stackb/rules_hugo.svg)](https://cirrus-ci.com/github/stackb/rules_hugo) 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
RulesHugo
13 | 14 | [Bazel](https://bazel.build) rules for building static websites with [Hugo](https://gohugo.io). 15 | 16 | ## Repository Rules 17 | 18 | | Name | Description | 19 | | -------------------: | :----------- | 20 | | [hugo_repository](#hugo_repository) | Load hugo dependency for this repo. | 21 | | [github_hugo_theme](#github_hugo_theme) | Load a hugo theme from github. | 22 | 23 | ## Build Rules 24 | 25 | | Name | Description | 26 | | -------------------: | :----------- | 27 | | [hugo_site](#hugo_site) | Declare a hugo site. | 28 | | [hugo_theme](#hugo_theme) | Declare a hugo theme. | 29 | 30 | ## Usage 31 | 32 | ### Add rules_hugo to your WORKSPACE and add a theme from github 33 | 34 | ```python 35 | # Update these to latest 36 | RULES_HUGO_COMMIT = "..." 37 | RULES_HUGO_SHA256 = "..." 38 | 39 | http_archive( 40 | name = "build_stack_rules_hugo", 41 | url = "https://github.com/stackb/rules_hugo/archive/%s.zip" % RULES_HUGO_COMMIT, 42 | sha256 = RULES_HUGO_SHA256, 43 | strip_prefix = "rules_hugo-%s" % RULES_HUGO_COMMIT 44 | ) 45 | 46 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_repository", "github_hugo_theme") 47 | 48 | # 49 | # Load hugo binary itself 50 | # 51 | # Optionally, load a specific version of Hugo, with the 'version' argument 52 | hugo_repository( 53 | name = "hugo", 54 | ) 55 | 56 | # 57 | # This makes a filegroup target "@com_github_yihui_hugo_xmin//:files" 58 | # available to your build files 59 | # 60 | github_hugo_theme( 61 | name = "com_github_yihui_hugo_xmin", 62 | owner = "yihui", 63 | repo = "hugo-xmin", 64 | commit = "c14ca049d0dd60386264ea68c91d8495809cc4c6", 65 | ) 66 | 67 | # 68 | # This creates a filegroup target from a released archive from GitHub 69 | # this is useful when a theme uses compiled / aggregated sources NOT found 70 | # in a source root. 71 | # 72 | http_archive( 73 | name = "com_github_thegeeklab_hugo_geekdoc", 74 | url = "https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.34.2/hugo-geekdoc.tar.gz", 75 | sha256 = "7fdd57f7d4450325a778629021c0fff5531dc8475de6c4ec70ab07e9484d400e", 76 | build_file_content=""" 77 | filegroup( 78 | name = "files", 79 | srcs = glob(["**"]), 80 | visibility = ["//visibility:public"] 81 | ) 82 | """ 83 | ) 84 | ``` 85 | 86 | ### Declare a hugo_site with a GitHub repository theme in your BUILD file 87 | 88 | ```python 89 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_site", "hugo_theme", "hugo_serve") 90 | 91 | # Declare a theme 'xmin'. In this case the `name` and 92 | # `theme_name` are identical, so the `theme_name` could be omitted in this case. 93 | hugo_theme( 94 | name = "xmin", 95 | theme_name = "xmin", 96 | srcs = [ 97 | "@com_github_yihui_hugo_xmin//:files", 98 | ], 99 | ) 100 | 101 | # Declare a site. Config file is required. 102 | my_site_name = "basic" 103 | 104 | hugo_site( 105 | name = my_site_name, 106 | config = "config.toml", 107 | content = [ 108 | "_index.md", 109 | "about.md", 110 | ], 111 | quiet = False, 112 | theme = ":xmin", 113 | ) 114 | 115 | # Run local development server 116 | hugo_serve( 117 | name = "local_%s" % my_site_name, 118 | dep = [":%s" % my_site_name], 119 | ) 120 | 121 | # Tar it up 122 | pkg_tar( 123 | name = "%s_tar" % my_site_name, 124 | srcs = [":%s" % my_site_name], 125 | ) 126 | ``` 127 | 128 | ### Declare a hugo_site with a GitHub released archive theme in your BUILD file 129 | ```python 130 | load("@build_stack_rules_hugo//hugo:rules.bzl", "hugo_site", "hugo_theme", "hugo_serve") 131 | 132 | hugo_theme( 133 | name = "hugo_theme_geekdoc", 134 | theme_name = "hugo-geekdoc", 135 | srcs = [ 136 | "@com_github_thegeeklab_hugo_geekdoc//:files", 137 | ], 138 | ) 139 | 140 | # Note, here we are using the config_dir attribute to support multi-lingual configurations. 141 | hugo_site( 142 | name = "site_complex", 143 | config_dir = glob(["config/**"]), 144 | content = glob(["content/**"]), 145 | data = glob(["data/**"]), 146 | quiet = False, 147 | theme = ":hugo_theme_geekdoc", 148 | ) 149 | 150 | # Run local development server 151 | hugo_serve( 152 | name = "serve", 153 | dep = [":site_complex"], 154 | ) 155 | ``` 156 | 157 | ### Previewing the site 158 | 159 | Execute the following command: 160 | 161 | ```shell 162 | bazel run //site_complex:serve 163 | ``` 164 | 165 | Then open your browser: [here](http://localhost:1313) 166 | 167 | 168 | ### Build the site 169 | 170 | The `hugo_site` target emits the output in the `bazel-bin` directory. 171 | 172 | ```sh 173 | $ bazel build :basic 174 | [...] 175 | Target //:basic up-to-date: 176 | bazel-bin/basic 177 | [...] 178 | ``` 179 | ```sh 180 | $ tree bazel-bin/basic 181 | bazel-bin/basic 182 | ├── 404.html 183 | ├── about 184 | │   └── index.html 185 | [...] 186 | ``` 187 | 188 | The `pkg_tar` target emits a `%{name}_tar.tar` file containing all the Hugo output files. 189 | 190 | ```sh 191 | $ bazel build :basic_tar 192 | [...] 193 | Target //:basic up-to-date: 194 | bazel-bin/basic_tar.tar 195 | ``` 196 | 197 | ## End 198 | 199 | See source code for details about additional rule attributes / parameters. 200 | -------------------------------------------------------------------------------- /site_simple/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content: -------------------------------------------------------------------------------- 1 | /*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.markdown{line-height:1.7}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown>:first-child{margin-top:0;line-height:1}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace;padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown pre code{padding:0;background:0 0}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table{border-spacing:0;border-collapse:collapse}.markdown table tr th,.markdown table tr td{padding:.5rem 1rem;line-height:1;border:1px solid #e9ecef}.markdown table tr:nth-child(2n){background:#f8f9fa}.markdown hr{height:1px;border:none;background:#e9ecef}.markdown-inner>:first-child{margin-top:0}.markdown-inner>:last-child{margin-bottom:0}.book-expand{border:1px solid #e9ecef}.book-expand .book-expand-head{background:#f8f9fa;padding:.5rem 1rem;cursor:pointer}.book-expand .book-expand-content{display:none;padding:1rem}.book-expand input[type=checkbox]:checked+.book-expand-content{display:block}.book-tabs{border:1px solid #e9ecef;display:flex;flex-wrap:wrap}.book-tabs label{display:inline-block;padding:.5rem 1rem;border-bottom:1px transparent;cursor:pointer}.book-tabs .book-tabs-content{order:999;width:100%;border-top:1px solid #f8f9fa;padding:1rem;display:none}.book-tabs input[type=radio]:checked+label{border-bottom:1px solid #004ed0}.book-tabs input[type=radio]:checked+label+.book-tabs-content{display:block}.book-columns>div{max-width:50%}.book-columns>div+div{margin-left:2rem}a.book-btn{display:inline-block;color:#004ed0!important;text-decoration:none!important;border:1px solid #004ed0;border-radius:.25rem;padding:.25rem 1rem;margin-top:.5rem;margin-bottom:.5rem;cursor:pointer}.flex{display:flex}.flex-auto{flex:1 1 auto}.flex-even{flex:1 1}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html,body{min-width:20rem;overflow-x:hidden}body{color:#343a40;background:#fff;font-family:sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside nav ul{padding:0;margin:0;list-style:none}aside nav ul li{margin:1em 0}aside nav ul a{display:block}aside nav ul a:hover{opacity:.5}aside nav ul ul{padding-left:1rem}ul.pagination{display:flex;justify-content:center}ul.pagination .page-item a{padding:1rem}.container{max-width:80rem;margin:0 auto}.book-brand{margin-top:0}.book-menu{flex:0 0 16rem;font-size:.875rem}.book-menu nav{width:16rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-menu a{color:#343a40}.book-menu a.active{color:#004ed0}.book-section-flat{margin-bottom:2rem;margin-top:2rem}.book-section-flat>a,.book-section-flat>span{font-weight:600}.book-section-flat>ul{padding-left:0}.book-page{min-width:20rem;flex-grow:1;padding:1rem}.book-header{margin-bottom:1rem;display:none}.book-toc{flex:0 0 14rem;font-size:.75rem}.book-toc nav{width:14rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-toc nav>ul>li:first-child{margin-top:0}.book-toc.level-1 ul ul,.book-toc.level-2 ul ul ul,.book-toc.level-3 ul ul ul ul,.book-toc.level-4 ul ul ul ul ul,.book-toc.level-5 ul ul ul ul ul ul,.book-toc.level-6 ul ul ul ul ul ul ul{display:none}.book-footer{display:flex;padding-top:1rem;font-size:.875rem;align-items:baseline}.book-footer img{width:1em;height:1em}.book-posts{min-width:20rem;max-width:41rem;flex-grow:1;padding:1rem}.book-posts article{padding-bottom:1rem}.book-home{padding:1rem}aside nav,.book-page,.book-posts,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}@media screen and (max-width:55rem){.book-toc{display:none}}@media screen and (max-width:41rem){.book-menu{margin-left:-16rem}.book-header{display:flex}#menu-control:checked+main .book-menu nav,#menu-control:checked+main .book-page,#menu-control:checked+main .book-posts{transform:translateX(16rem)}#menu-control:checked+main .book-header label{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:80rem){.book-page,.book-posts,.book-menu nav,.book-toc nav{padding:2rem 1rem}}@font-face{font-family:oxygen;font-style:normal;font-weight:300;font-display:swap;src:url(/fonts/oxygen-v8-latin-300.eot);src:local("Oxygen Light"),local(Oxygen-Light),url(/fonts/oxygen-v8-latin-300.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-300.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-300.woff) format("woff"),url(/fonts/oxygen-v8-latin-300.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-300.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-v8-latin-regular.eot);src:local("Oxygen Regular"),local(Oxygen-Regular),url(/fonts/oxygen-v8-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-regular.woff) format("woff"),url(/fonts/oxygen-v8-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-regular.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/oxygen-v8-latin-700.eot);src:local("Oxygen Bold"),local(Oxygen-Bold),url(/fonts/oxygen-v8-latin-700.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-700.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-700.woff) format("woff"),url(/fonts/oxygen-v8-latin-700.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-700.svg#Oxygen) format("svg")}@font-face{font-family:oxygen mono;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-mono-v6-latin-regular.eot);src:local("Oxygen Mono"),local(OxygenMono-Regular),url(/fonts/oxygen-mono-v6-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-mono-v6-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-mono-v6-latin-regular.woff) format("woff"),url(/fonts/oxygen-mono-v6-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-mono-v6-latin-regular.svg#OxygenMono) format("svg")}body{font-family:oxygen,sans-serif} -------------------------------------------------------------------------------- /hugo/internal/hugo_site.bzl: -------------------------------------------------------------------------------- 1 | def relative_path(src, dirname): 2 | """Given a src File and a directory it's under, return the relative path. 3 | 4 | Args: 5 | src: File(path/to/site/content/docs/example1.md) 6 | dirname: string("content") 7 | 8 | Returns: 9 | string 10 | """ 11 | 12 | # Find the last path segment that matches the given dirname, and return that 13 | # substring. 14 | if src.short_path.startswith("/"): 15 | i = src.short_path.rfind("/%s/" % dirname) 16 | if i == -1: 17 | fail("failed to get relative path: couldn't find %s in %s" % (dirname, src.short_path)) 18 | return src.short_path[i + 1:] 19 | 20 | i = src.short_path.rfind("%s/" % dirname) 21 | if i == -1: 22 | fail("failed to get relative path: couldn't find %s in %s" % (dirname, src.short_path)) 23 | return src.short_path[i:] 24 | 25 | def copy_to_dir(ctx, srcs, dirname): 26 | outs = [] 27 | for i in srcs: 28 | if i.is_source: 29 | o = ctx.actions.declare_file(relative_path(i, dirname)) 30 | ctx.actions.run( 31 | inputs = [i], 32 | executable = "cp", 33 | arguments = ["-r", "-L", i.path, o.path], 34 | outputs = [o], 35 | ) 36 | outs.append(o) 37 | else: 38 | outs.append(i) 39 | return outs 40 | 41 | def _hugo_site_impl(ctx): 42 | hugo = ctx.executable.hugo 43 | hugo_inputs = [] 44 | hugo_outputdir = ctx.actions.declare_directory(ctx.label.name) 45 | hugo_outputs = [hugo_outputdir] 46 | hugo_args = [] 47 | 48 | if ctx.file.config == None and (ctx.files.config_dir == None or len(ctx.files.config_dir) == 0): 49 | fail("You must provide either a config file or a config_dir") 50 | 51 | # Copy the config file into place 52 | config_dir = ctx.files.config_dir 53 | 54 | if config_dir == None or len(config_dir) == 0: 55 | config_file = ctx.actions.declare_file(ctx.file.config.basename) 56 | 57 | ctx.actions.run_shell( 58 | inputs = [ctx.file.config], 59 | outputs = [config_file], 60 | command = 'cp -L "$1" "$2"', 61 | arguments = [ctx.file.config.path, config_file.path], 62 | ) 63 | 64 | hugo_inputs.append(config_file) 65 | 66 | hugo_args += [ 67 | "--source", 68 | config_file.dirname, 69 | ] 70 | else: 71 | placeholder_file = ctx.actions.declare_file(".placeholder") 72 | ctx.actions.write(placeholder_file, "paceholder", is_executable=False) 73 | hugo_inputs.append(placeholder_file) 74 | # placeholder_file.dirname + "/config/_default/config.yaml", 75 | hugo_args += [ 76 | "--source", placeholder_file.dirname 77 | ] 78 | 79 | # Copy all the files over 80 | for name, srcs in { 81 | "archetypes": ctx.files.archetypes, 82 | "assets": ctx.files.assets, 83 | "content": ctx.files.content, 84 | "data": ctx.files.data, 85 | "i18n": ctx.files.i18n, 86 | "images": ctx.files.images, 87 | "layouts": ctx.files.layouts, 88 | "static": ctx.files.static, 89 | "config": ctx.files.config_dir, 90 | }.items(): 91 | hugo_inputs += copy_to_dir(ctx, srcs, name) 92 | 93 | # Copy the theme 94 | if ctx.attr.theme: 95 | theme = ctx.attr.theme.hugo_theme 96 | hugo_args += ["--theme", theme.name] 97 | for i in theme.files.to_list(): 98 | path_list = i.short_path.split("/") 99 | if i.short_path.startswith("../"): 100 | o_filename = "/".join(["themes", theme.name] + path_list[2:]) 101 | elif i.short_path[len(theme.path):].startswith("/themes"): # check if themes is the first dir after theme path 102 | indx = path_list.index("themes") 103 | o_filename = "/".join(["themes", theme.name] + path_list[indx+2:]) 104 | else: 105 | o_filename = "/".join(["themes", theme.name, i.short_path[len(theme.path):]]) 106 | o = ctx.actions.declare_file(o_filename) 107 | ctx.actions.run_shell( 108 | inputs = [i], 109 | outputs = [o], 110 | command = 'cp -r -L "$1" "$2"', 111 | arguments = [i.path, o.path], 112 | ) 113 | hugo_inputs.append(o) 114 | 115 | # Prepare hugo command 116 | hugo_args += [ 117 | "--destination", 118 | ctx.label.name, 119 | ] 120 | 121 | if ctx.attr.quiet: 122 | hugo_args.append("--quiet") 123 | if ctx.attr.verbose: 124 | hugo_args.append("--verbose") 125 | if ctx.attr.base_url: 126 | hugo_args += ["--baseURL", ctx.attr.base_url] 127 | if ctx.attr.build_drafts: 128 | hugo_args += ["--buildDrafts"] 129 | 130 | ctx.actions.run( 131 | mnemonic = "GoHugo", 132 | progress_message = "Generating hugo site", 133 | executable = hugo, 134 | arguments = hugo_args, 135 | inputs = hugo_inputs, 136 | outputs = hugo_outputs, 137 | tools = [hugo], 138 | execution_requirements = { 139 | "no-sandbox": "1", 140 | }, 141 | ) 142 | 143 | files = depset([hugo_outputdir]) 144 | runfiles = ctx.runfiles(files = [hugo_outputdir] + hugo_inputs) 145 | 146 | return [DefaultInfo( 147 | files = files, 148 | runfiles = runfiles, 149 | )] 150 | 151 | hugo_site = rule( 152 | attrs = { 153 | # Hugo config file 154 | "config": attr.label( 155 | allow_single_file = [ 156 | ".toml", 157 | ".yaml", 158 | ".yml", 159 | ".json", 160 | ], 161 | ), 162 | # For use of config directories 163 | "config_dir": attr.label_list( 164 | allow_files = True, 165 | ), 166 | # Files to be included in the content/ subdir 167 | "content": attr.label_list( 168 | allow_files = True, 169 | mandatory = True, 170 | ), 171 | # Files to be included in the archetypes/ subdir 172 | "archetypes": attr.label_list( 173 | allow_files = True, 174 | ), 175 | # Files to be included in the static/ subdir 176 | "static": attr.label_list( 177 | allow_files = True, 178 | ), 179 | # Files to be included in the images/ subdir 180 | "images": attr.label_list( 181 | allow_files = True, 182 | ), 183 | # Files to be included in the layouts/ subdir 184 | "layouts": attr.label_list( 185 | allow_files = True, 186 | ), 187 | # Files to be included in the assets/ subdir 188 | "assets": attr.label_list( 189 | allow_files = True, 190 | ), 191 | # Files to be included in the data/ subdir 192 | "data": attr.label_list( 193 | allow_files = True, 194 | ), 195 | # Files to be included in the i18n/ subdir 196 | "i18n": attr.label_list( 197 | allow_files = True, 198 | ), 199 | # The hugo executable 200 | "hugo": attr.label( 201 | default = "@hugo//:hugo", 202 | allow_files = True, 203 | executable = True, 204 | cfg = "host", 205 | ), 206 | # Optionally set the base_url as a hugo argument 207 | "base_url": attr.string(), 208 | "theme": attr.label( 209 | providers = ["hugo_theme"], 210 | ), 211 | # Emit quietly 212 | "quiet": attr.bool( 213 | default = True, 214 | ), 215 | # Emit verbose 216 | "verbose": attr.bool( 217 | default = False, 218 | ), 219 | # Build content marked as draft 220 | "build_drafts": attr.bool( 221 | default = False, 222 | ), 223 | }, 224 | implementation = _hugo_site_impl, 225 | ) 226 | 227 | _SERVE_SCRIPT_PREFIX = """#!/bin/bash 228 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 229 | 230 | trap exit_gracefully SIGINT 231 | function exit_gracefully() { 232 | exit 0; 233 | } 234 | 235 | """ 236 | _SERVE_SCRIPT_TEMPLATE = """{hugo_bin} serve -s $DIR {args}""" 237 | 238 | def _hugo_serve_impl(ctx): 239 | """ This is a long running process used for development""" 240 | hugo = ctx.executable.hugo 241 | hugo_outfile = ctx.actions.declare_file("{}.out".format(ctx.label.name)) 242 | hugo_outputs = [hugo_outfile] 243 | hugo_args = [] 244 | 245 | if ctx.attr.quiet: 246 | hugo_args.append("--quiet") 247 | if ctx.attr.quiet: 248 | hugo_args.append("--verbose") 249 | if ctx.attr.disable_fast_render: 250 | hugo_args.append("--disableFastRender") 251 | 252 | executable_path = "./" + ctx.attr.hugo.files_to_run.executable.short_path 253 | 254 | runfiles = ctx.runfiles() 255 | runfiles = runfiles.merge(ctx.runfiles(files=[ctx.attr.hugo.files_to_run.executable])) 256 | 257 | for dep in ctx.attr.dep: 258 | runfiles = runfiles.merge(dep.default_runfiles).merge(dep.data_runfiles).merge(ctx.runfiles(files=dep.files.to_list())) 259 | 260 | 261 | script = ctx.actions.declare_file("{}-serve".format(ctx.label.name)) 262 | script_content = _SERVE_SCRIPT_PREFIX + _SERVE_SCRIPT_TEMPLATE.format( 263 | hugo_bin=executable_path, 264 | args=" ".join(hugo_args), 265 | ) 266 | ctx.actions.write(output=script, content=script_content, is_executable=True) 267 | 268 | ctx.actions.run_shell( 269 | mnemonic = "GoHugoServe", 270 | tools = [script, hugo], 271 | command = script.path, 272 | outputs = hugo_outputs, 273 | execution_requirements={ 274 | "no-sandbox": "1", 275 | }, 276 | ) 277 | 278 | return [DefaultInfo(executable=script, runfiles=runfiles)] 279 | 280 | 281 | hugo_serve = rule( 282 | attrs = { 283 | # The hugo executable 284 | "hugo": attr.label( 285 | default = "@hugo//:hugo", 286 | allow_files = True, 287 | executable = True, 288 | cfg = "host", 289 | ), 290 | "dep": attr.label_list( 291 | mandatory=True, 292 | ), 293 | # Disable fast render 294 | "disable_fast_render": attr.bool( 295 | default = False, 296 | ), 297 | # Emit quietly 298 | "quiet": attr.bool( 299 | default = True, 300 | ), 301 | # Emit verbose 302 | "verbose": attr.bool( 303 | default = False, 304 | ), 305 | }, 306 | implementation = _hugo_serve_impl, 307 | executable = True, 308 | ) 309 | --------------------------------------------------------------------------------