diff --git a/.github/workflows/rake.yml b/.github/workflows/rake.yml index b13a247..c82bf5e 100644 --- a/.github/workflows/rake.yml +++ b/.github/workflows/rake.yml @@ -12,4 +12,4 @@ jobs: rake: uses: metanorma/ci/.github/workflows/generic-rake.yml@main secrets: - pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} + pat_token: ${{ secrets.RIBOSE_CI_PAT_TOKEN }} diff --git a/.gitignore b/.gitignore index 5f4a30e..3a47b21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -_site/* +_site*/* *.scssc Gemfile.lock -jekyll-theme-rop-*.gem \ No newline at end of file +prexian-*.gem +_hub-site +coverage +pkg/ \ No newline at end of file diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..8bcb8ae --- /dev/null +++ b/.rspec @@ -0,0 +1,4 @@ +--require spec_helper +--exclude-pattern "spec/fixtures/**/*_spec.rb" +--format documentation +--color diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ec565fa..213927d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -11,14 +11,14 @@ # Include: **/*.gemspec Gemspec/RequiredRubyVersion: Exclude: - - 'jekyll-theme-rop.gemspec' + - 'prexian.gemspec' # Offense count: 2 # Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - - 'lib/rop/filterable_index.rb' - - 'lib/rop/png_diagram_page.rb' + - 'lib/prexian/filterable_index.rb' + - 'lib/prexian/png_diagram_page.rb' # Offense count: 11 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. @@ -69,7 +69,7 @@ Naming/FileName: Exclude: - 'Rakefile.rb' - 'lib/jekyll-theme-open-project.rb' - - 'lib/jekyll-theme-rop.rb' + - 'lib/prexian.rb' # Offense count: 1 # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs. @@ -80,12 +80,12 @@ Naming/FileName: Naming/PredicateName: Exclude: - 'spec/**/*' - - 'lib/rop/project_reader.rb' + - 'lib/prexian/project_reader.rb' # Offense count: 1 Style/ClassVars: Exclude: - - 'lib/rop/project_reader.rb' + - 'lib/prexian/project_reader.rb' # Offense count: 9 # Configuration parameters: AllowedConstants. @@ -93,11 +93,11 @@ Style/Documentation: Exclude: - 'spec/**/*' - 'test/**/*' - - 'lib/jekyll-theme-rop.rb' - - 'lib/rop/filterable_index.rb' - - 'lib/rop/png_diagram_page.rb' - - 'lib/rop/project_reader.rb' - - 'lib/rop/spec_builder.rb' + - 'lib/prexian.rb' + - 'lib/prexian/filterable_index.rb' + - 'lib/prexian/png_diagram_page.rb' + - 'lib/prexian/project_reader.rb' + - 'lib/prexian/spec_builder.rb' # Offense count: 5 # Configuration parameters: AllowedVariables. diff --git a/Gemfile b/Gemfile index 8fc1bbb..383b5f2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ # frozen_string_literal: true source 'https://rubygems.org' + +# Specify your gem's dependencies in prexian.gemspec gemspec -gem 'bundler' -gem 'rake' -gem 'rubocop' +gem 'rake', '~> 13.0' diff --git a/README.md b/README.md index 0df46d3..73758b7 100644 --- a/README.md +++ b/README.md @@ -1,1082 +1,1247 @@ -# The ROP Jekyll theme (Ribose Open Project theme) +# Prexian -ROP is a Jekyll theme (with accompanying plugin code) aiming to help -organizations and individuals present open-source software and specifications in -a navigable and elegant way. +*A Jekyll theme for open-source software and specification projects* -The gem is released as `jekyll-theme-rop`. +[](https://badge.fury.io/rb/prexian) +[](https://github.com/riboseinc/prexian/actions) -ROP fits two types of sites: +Prexian is a powerful Jekyll theme designed to help organizations and individuals present open-source software and specifications in a navigable and elegant way. It supports both individual project sites and hub sites that aggregate multiple projects. -* a site that describes one individual project; -* a site that combine multiple project sites into an open hub site. +## ✨ Features -**Demo**: See [Ribose](https://www.ribose.com/) project sites -- for example, -[Metanorma](https://www.metanorma.com), -[RNP](https://www.rnpgp.com), -[Cryptode](https://www.cryptode.com), -[Relaton](https://www.relaton.com). +- **Two Site Types**: Create individual project sites or hub sites that aggregate multiple projects +- **Smart Content Management**: Automatically fetch and display software documentation, specifications, and project metadata from Git repositories +- **Performance Optimized**: Intelligent caching system with shallow clones and sparse checkout +- **Modern Design**: Clean, responsive design with customizable styling +- **SEO Ready**: Built-in SEO optimization with jekyll-seo-tag integration +- **Blog Support**: Full-featured blogging with author profiles and social links +- **Search Integration**: Optional Algolia search support +- **AsciiDoc Support**: First-class support for AsciiDoc content authoring -See also: CI_OPS for how to set up automated build and deployment of sites -to AWS S3. +## 🚀 Quick Start -NOTE: This theme was previously named `jekyll-theme-open-project` with a helper -gem `jekyll-theme-open-project-helpers`. +### Installation +Add this line to your Jekyll site's `Gemfile`: -## Migrating from `jekyll-theme-open-project` to the new `jekyll-theme-rop` - -Follow these steps: - -1. Update your Open Project Gemfile to remove all previously used dependencies -from `jekyll-theme-open-project` (including `git`), and replace it like this: ```ruby -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-theme-rop" -end +gem "prexian" ``` -2. Update your `_config.yml` file to remove all previously used plugins from `jekyll-theme-open-project` and only use `jekyll-theme-rop`, so it becomes: -```yaml -plugins: - - jekyll-theme-rop -``` - -3. Replace in SCSS files all mention of import files with their renamed counterparts: - * `@import 'jekyll-theme-open-project'` => ``@import 'jekyll-theme-rop'` - * `'open-project-mixins'` => remove because it was already included. +And then execute: -4. If you use the `png_diagrams` feature in any page layout, replace as follows: -```diff --engine: png_diagrams -+engine: png_diagram_page +```bash +$ bundle install ``` +Or install it yourself as: -## Contents - -* Creating a site: [how to](#starting-a-site-with-this-theme) - - * [General site setup](#general-setup) - * [Hub site setup](#hub-site) - * [Project site setup](#project-site) and describing your software and specs +```bash +$ gem install prexian +``` -* Customizing site looks: +### Basic Setup - * [Style customization](#style-customization) - * [SVG guidelines](#svg-guidelines) - * [Content guidelines](#content-guidelines) +1. **Create a new Jekyll site**: + ```bash + jekyll new my-project-site + cd my-project-site + ``` -* [Authoring content](#authoring-content) +2. **Add Prexian to your Gemfile**: + ```ruby + gem "prexian" + ``` -* References: +3. **Configure your site** in `_config.yml`: + ```yaml + theme: prexian - * [Layouts](#theme-layouts) - * [Includes](#theme-includes) + plugins: + - prexian + prexian: + title: My Project + description: An awesome open-source project + tagline: Making the world a better place + site_type: project # or 'hub' + ``` -## Getting started +4. **Build and serve**: + ```bash + bundle exec jekyll serve + ``` -### Set up Ruby and Jekyll +## 📋 Minimum Requirements -The currently recommended Ruby version is 3.3. +### Required Configuration -NOTE: In case you don't use Ruby often, the easiest way to install one may be -with RVM. +Every Prexian site must have these minimum configuration settings in `_config.yml`: -The currently recommended Jekyll version is 3 or newer -(read about [Jekyll installation](https://jekyllrb.com/docs/#instructions)). +```yaml +# Basic Jekyll configuration +title: Your Site Title +description: Your site description -NOTE: This theme is known to not work with Ruby older than 2.3. -It has not been tested on newer versions. +# Theme configuration +theme: prexian +plugins: + - prexian -### Start a new Jekyll site +# Prexian configuration (required) +prexian: + site_type: project # or 'hub' - REQUIRED + title: Your Project Title + description: Your project description -```sh -jekyll new my-open-site +# Collections (required for content types you want to use) +collections: + software: + output: true + permalink: /software/:path/ + specs: + output: true + permalink: /specs/:path/ + posts: + output: true + permalink: /blog/:year-:month-:day-:title/ + # For hub sites only: + projects: + output: false + +# Defaults (required) +defaults: + - scope: + path: "" + values: + layout: default + - scope: + path: _posts + type: posts + values: + layout: post + - scope: + path: _software + type: software + values: + layout: product + - scope: + path: _specs + type: specs + values: + layout: spec ``` -If you use Git for site source version management, -see the “Extra .gitignore rules” section below -for additional lines you should add to your `.gitignore`. +### Required Files -### Install Open Site theme into the Jekyll site +#### For All Sites -Add this line to your Jekyll site's `Gemfile`, -replacing default theme requirement: +- **`_config.yml`** - Site configuration (see above) +- **`index.md`** - Homepage content: + ```yaml + --- + layout: home + --- -```ruby -gem "jekyll-theme-rop" -``` + Your homepage content here... + ``` -(Jekyll’s default theme was “minima” at the time of this writing.) +#### For Project Sites -Also in the `Gemfile`, add two important plugins to the `:jekyll_plugins` group. -(The SEO tag plugin is not mandatory, but these docs assume you use it.) +If your project site has a parent hub, add this to `_config.yml`: -```ruby -group :jekyll_plugins do - gem "jekyll-theme-rop" - - # The following gems are automatically included by jekyll-theme-rop - # gem "jekyll-seo-tag" - # gem "jekyll-sitemap" - # gem "jekyll-data" - # gem "jekyll-asciidoc" - # gem "jekyll-external-links" - - # ...other plugins, if you use any -end +```yaml +prexian: + hub: + git_repo_url: https://github.com/your-org/hub-site + git_repo_branch: main # optional, defaults to 'main' + home_url: https://your-hub-site.com/ ``` -Execute the following to install dependencies: - - $ bundle - -### Configure your Open Site for the first time - -Edit `_config.yml` to add necessary site-wide configuration options, -and add files and folders to site contents. This step depends -on the type of site you’re creating: hub or individual project site. - -Further sections explain core concepts of open project and hub, and go -into detail about how to configure a project or hub site. - -Before building the first time you must do this: - -1. Configure [common settings](#common-settings) -2. Add your logo(s) according to [logo](#logo) - -Please see the [configuration section](#configuration) for more details. - -NOTE: It may be required to copy the following properties from -this theme’s `_config.yaml` to your site’s: `collections`, `includes_dir`. - -This is likely caused by changed behavior of jekyll-data gem in recent versions, -which is responsible for “inheritance” of `_config.yaml` between theme and site. +#### For Hub Sites -You can add any custom collections for your site -after collections copied from theme’s config. +- **`assets/img/symbol.svg`** - Your site's logo (SVG format recommended) inserted at the footer +- **`title.html`** - Your site's title (HTML format recommended) to be included in the footer +Without these two files the rendering of a project site will crash. -### Building site +TODO: Fix this problem by detecting and skipping. -Execute to build the site locally and watch for changes: - $ bundle exec jekyll serve --host mysite.local --port 4000 +- a **`_projects`** directory with project definitions: -This assumes you have mysite.local mapped in your hosts file, -otherwise omit --host and it’ll use “localhost” as domain name. +```yaml +# _projects/my-project.md +--- +title: My Project +description: Brief project description +site: + git_repo_url: https://github.com/your-org/my-project-site + git_repo_branch: main +home_url: https://your-org.github.io/my-project/ +--- +Detailed project description... +``` -## Configuration +### Optional Files -There are 3 areas to configure when you first create an Open Site, namely: +#### Site Favicon -* [Common setup](#common-setup), settings that apply to both Hub and Project sites; -* [Hub site](#hub-site); -* [Project site](#project-site) +- **`assets/favicon.png`** - Site favicon +#### Custom Styling -## Common setup +- **`assets/css/style.scss`** - Custom styles: + ```scss + --- + --- -### Git repository branch behavior + ... + @import "prexian"; + @import "prexian/custom-styles"; -You’ll see many instances of document frontmatter -referencing Git repository URLs. + // Your custom styles here + ``` -Note that, wherever a `[*_]repo_url` property is encountered, -a sibling property `[*_]repo_branch` is supported. -(This is new in 2.1.17, until that version branch “master” was used for all repositories.) +#### Content Pages -If you reference repositories that don’t use branch name “main”, -you must either: +- **`_pages/`** - Static pages (about, contact, etc.) +- **`_posts/`** - Blog posts +- **`_software/`** - Software components +- **`_specs/`** - Specifications -- use a sibling `[*_]repo_branch` property to specify your custom branch name - (you can search for `git_repo_branch`, `repo_branch`, `github_repo_branch` - in this document for examples), or +### Directory Structure Example -- specify `default_repo_branch` property in `config.yml` +``` +my-project-site/ +├── _config.yml # Required: Site configuration +├── index.md # Required: Homepage +├── Gemfile # Required: Dependencies +├── title.html # Required (for hub): Title file +├── assets/ +│ ├── symbol.svg # Required (for hub): Site logo +│ └── css/ +│ └── style.scss # Optional: Custom styles +├── _pages/ # Optional: Static pages +│ ├── about.md +│ └── contact.md +├── _posts/ # Optional: Blog posts +│ └── 2024-01-01-welcome.md +├── _software/ # Optional: Software components +│ └── my-tool.md +└── _specs/ # Optional: Specifications + └── my-spec.md +``` - (in this case, in scenarios with project sites being used in conjunction - with a hub site, `default_repo_branch` must be the same - across all project sites’ and their hub site’s `config.yml`—otherwise you’re advised - to use the previous option to avoid site build failure). +This is the absolute minimum needed to get a Prexian site running. You can then add content and customize as needed. -Note that, when a referenced Git repository doesn’t contain the necessary branch -(either explicitly specified custom branch, or `default_repo_branch`, or branch called “main”), -this will cause build failure of that project site, or a hub site using that project site. +## 📖 Site Types -### Common settings +Prexian supports two distinct types of sites, each with specific purposes and capabilities: -(mandatory) +### Project Site -These settings apply to both site types (hub and project). +A **project site** describes one individual project and can contain: -- You may want to remove the default `about.md` page added by Jekyll, - as this theme does not account for its existence. +- **Software components**: Individual software products with their documentation +- **Specifications**: Technical specifications and standards +- **Blog posts**: Project-specific announcements and articles +- **Documentation**: Project-wide documentation and guides +- **Pages**: Static pages for additional content -- Add `hero_include: home-hero.html` to YAML frontmatter - in your main `index.md`. +Project sites are designed to be comprehensive resources for a single project, providing everything users need to understand, use, and contribute to the project. -- Add following items to site’s `_config.yml` - (and don’t forget to remove default theme requirement there): +```yaml +# _config.yml for project site +prexian: + site_type: project + hub: + git_repo_url: https://github.com/your-org/hub-site + git_repo_branch: main + home_url: https://your-org.github.io/ +``` - ```yaml - url: https://example.com - # Site’s URL with protocol, without optional www. prefix - # and without trailing slash. - # Used e.g. for marking external links in docs and blog posts. - - github_repo_url: https://github.com/example-org/example.com - # URL to GitHub repo for the site. - # Using GitHub & specifying this setting is currently required - # for “suggest edits” buttons to show on documentation pages. - github_repo_branch: main - # Optional, default is `main`. +### Hub Site - title: Example - description: The example of examples - # The above two are used by jekyll-seo-tag for things such as - # `
{{ site.description }}
+{{ member.role }}
+