Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9fec70b
add _learn
escherize Mar 27, 2025
b5a2d1e
add a subset of _docs
escherize Mar 27, 2025
2dbc59e
add dotfiles except .github (will checkout workflows first to make su…
escherize Mar 27, 2025
a9348bf
add more _docs versions
escherize Mar 27, 2025
a7f4803
add the rest of _docs versions
escherize Mar 27, 2025
010a630
Add .github _except cd-jekyll_
escherize Mar 27, 2025
7a944e2
add cd-jekyll.yml
escherize Mar 28, 2025
1f8e4ab
CNAME -> docs.metabase.com
escherize Mar 28, 2025
ada0632
do not output blog authors section + remove _blog-authors
escherize Mar 28, 2025
cfc4d05
fix typo
escherize Mar 28, 2025
c2de9c1
remove _learn, and do not output it
escherize Mar 28, 2025
2e6adac
show _docs folder at root instead of /docs/
escherize Mar 28, 2025
619f70f
break redirect loop
escherize Mar 28, 2025
b7c5eac
break redirect loop 2
escherize Mar 28, 2025
3d54424
remove root index (should come from _docs)
escherize Mar 28, 2025
a999387
move _docs to _posts, remove custom stuff from config
escherize Mar 28, 2025
f8a52d8
got latest page mostly working!
escherize Mar 31, 2025
d9af5cf
build the page
escherize Mar 31, 2025
fd19bbd
add ruby version file
escherize Mar 31, 2025
090970a
add missing include
escherize Mar 31, 2025
40a904b
add missing layout, and start on actions subdir
escherize Apr 1, 2025
51d811d
add _docs/latest/embedding
escherize Apr 1, 2025
e008481
fix paths + add missing youtube include
escherize Apr 1, 2025
d8549ce
things are mostly working + copy all of latest
escherize Apr 1, 2025
b325ab8
don't actually redirect to docs.metabase.com
escherize Apr 1, 2025
c6bb349
add sidebar data
escherize Apr 1, 2025
438e72b
fixing things + add yarn.lock
escherize Apr 1, 2025
e147fb4
add x86_64-linux platform in Gemfile
escherize Apr 1, 2025
3e7d79e
add stitch outbound links script
escherize Apr 1, 2025
e3a019a
stitch outbound links (learn only)
escherize Apr 1, 2025
8843f78
update script to stitch links in _data/**.y{a,}ml
escherize Apr 1, 2025
002d135
stitch the rest of _docs
escherize Apr 1, 2025
1f07807
reindent latest.yml
escherize Apr 1, 2025
901c2a0
process _data/docs/nav/latest + bump script
escherize Apr 1, 2025
bbe8b62
dry runs reindent yaml files
escherize Apr 1, 2025
a98cdd2
add _data/feature-comparison
escherize Apr 1, 2025
8d1f1e2
add indent yaml task (helps see what links changed)
escherize Apr 1, 2025
dc97748
add paid features and some missing images
escherize Apr 2, 2025
a21d024
indent feature-comparison.yml\
escherize Apr 2, 2025
4970eac
update yaml link stitching automation
escherize Apr 2, 2025
787c82d
add check.svg
escherize Apr 2, 2025
e5efd5d
stitch links in feature-comparison.yml
escherize Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Did you remember to add a trailing slash if you added permalink frontmatter?
- If you wrote a new blog post, have you added `redirect_from` in frontmatter?
4 changes: 4 additions & 0 deletions .github/crush-pics/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"compression_mode": "lossless",
"strip_tags": false
}
1 change: 1 addition & 0 deletions .github/links-to-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
All links are valid, nothing to see here.
112 changes: 112 additions & 0 deletions .github/refresh-roadmap/refresh-roadmap.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
require 'uri'
require 'net/http'
require 'json'
require 'yaml'

def slugify(str)
str.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
end

# Used to standardize the description format.
def add_period_if_missing(string)
terminal_punctuation = [".", "!", "?"].freeze
string << "." unless string.end_with?(*terminal_punctuation)
string
end

# Removes Ruby symbol colons from keys (for YAML)
def clear_keys(hash)
hash.map do |k, v|
k = k.to_s
if v.is_a?(Hash)
v = clear_keys(v)
elsif v.is_a?(Array)
v = v.map do |item|
i = clear_keys(item) if item.is_a?(Hash)
i
end
end

[k, v]
end.to_h
end

# Check for ENV vars
["NOTION_TOKEN", "NOTION_DB_ID", "TARGET_PATH"].each do |v|
raise "Need to provide #{v} as an environment variable for this to work." if ENV[v].nil?
end

# Preps the request
uri = URI("https://api.notion.com/v1/databases/#{ENV['NOTION_DB_ID']}/query")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.request_uri)
request["Authorization"] = "Bearer #{ENV['NOTION_TOKEN']}"
request["Notion-Version"] = "2022-06-28"
request["Accept"] = "application/json"
request["Content-Type "] = "application/json"
response = http.request(request)

# If it's not a failure
if response.is_a?(Net::HTTPSuccess)
puts "Roadmap data loaded. Processing..."

# Parses the response
content = JSON.parse(response.body)

# Preps the object to be serialized later
output = {
:now => [],
:soon => [],
:later => []
}

# Maps each row to a column, with properly transformed properties
content["results"].each do |row|
group = nil
entry = {}

row["properties"].each_pair do |name, val|
case name
when "Status" then group = slugify(row["properties"]["Status"]["select"]["name"]).to_sym # Target for later
when "Title" then entry[:title] = val["title"][0]["text"]["content"]
when "Description" then entry[:description] = add_period_if_missing(val["rich_text"][0]["text"]["content"]) unless val["rich_text"].empty?
when "Release" then entry[:release] = val["select"]["name"] unless val["select"].empty?
when "Paid" then entry[:paid] = val["checkbox"]
end
end

output[group] = [] if output[group].nil?
output[group] << entry
end

# Only select the statuses we need for the roadmap
output.select! { |key, _| [:now, :soon, :later].include?(key) }

# Sort by paid, then alphabetically by title
[:now, :soon, :later].each do |group|
output[group].sort_by! { |entry| [entry[:paid] ? 0 : 1, entry[:title]] }
end

# Add one-by-two class to now, soon, and later
[:now, :soon, :later].each do |group|
# The `one-by-two` class is used to style these two sections
output[group].each do |entry|
entry[:class] = "one-by-two"
end
end

# Emtpy the target file and write the serialized YAML to it
output = clear_keys(output)
File.open(ENV['TARGET_PATH'], 'w') do |file|
file.truncate 0
file.write output.to_yaml
end

# Call it a day
puts "Roadmap data written to #{ENV['TARGET_PATH']}."
else
# This should prevent a broken roadmap version to be checked in
raise "Could not get database from Notion"
end
20 changes: 20 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# For now we want to only check for stale pull requests
only: pulls

# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7

# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue was automatically marked as stale due to a lack of recent activity.
If you'd like to revive it, please comment or update as requested!

# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
68 changes: 68 additions & 0 deletions .github/workflows/cd-jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy Jekyll site to Pages

on:
push:
branches: ["master", "transfering_old_docs_site"] # run it from this branch, for faster iteration

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby # uses version from .ruby-version
uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.179.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Minifiers
run: npm install -g uglify-js csso-cli
- name: Minify JavaScript
run: |
find _site -name "*.js" -exec uglifyjs --compress --mangle -o {} -- {} \;
- name: Minify CSS
run: |
find _site -name "*.css" -exec csso --input {} --output {} \;
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

60 changes: 60 additions & 0 deletions .github/workflows/ci-jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Jekyll site CI

on:
push:
branches:
- master
pull_request:
branches:
- master
# `refresh-docs.yml` cannot trigger workflows with its `GITHUB_TOKEN` except through an explicit `workflow_dispatch`
# (cf. https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow):
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Ruby # uses version from .ruby-version
uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 # v1.179.0
with:
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 14
cache: "yarn"

- name: Install packages
run: yarn

- name: "Lint markdown"
run: "yarn lint-markdown"

- name: "Lint styles"
run: "yarn lint-styles"

- name: "Validate links"
run: "yarn lint-links"

- name: "Lint scripts"
run: "yarn lint-scripts"

- name: Build Jekyll Site
env:
JEKYLL_ENV: staging
NODE_ENV: production
run: "script/build"

- name: "Check all links"
run: "script/links"
21 changes: 21 additions & 0 deletions .github/workflows/crush-pics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Crush images
on:
pull_request:
branches:
- master
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.gif'
# jobs:
# crush:
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Crush images
# uses: crush-pics/crush-pics-github-action@master
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# api-key: ${{ secrets.CRUSH_PICS_API_KEY }}
39 changes: 39 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Links

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Ruby # uses version from .ruby-version
uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 # v1.179.0
with:
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Build Jekyll Site
env:
JEKYLL_ENV: staging
run: "script/build"

- name: "Check all links"
id: htmlproofer
run: "script/links > ./.github/links-to-fix.md"

- name: Create Issue From File
if: steps.htmlproofer.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./.github/links-to-fix.md
assignees: jeff-bruemmer

41 changes: 41 additions & 0 deletions .github/workflows/refresh-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Refresh docs"
on:
schedule:
- cron: "0 0 * * 1-5"
# Run every hour so we can test properly
# - cron: "0 */1 * * 1-5"

jobs:
update-latest-and-master-docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- name: Update docs
run: |
./script/docs-update
./script/docs master --set-version master
- name: Create a pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if git diff --quiet ; then
echo "No changes to commit."
else
git config user.email "[email protected]"
git config user.name "Metabase Docs bot"
update_branch="docs-update-${{ github.run_number }}"
git switch --create "${update_branch}"
git add .
git commit \
--author="Metabase Docs bot <[email protected]>" \
--message="Update master and latest docs"
git push --force -u origin "${update_branch}"
gh pr create --title "Refresh docs (nightly)" --body ""
# `GITHUB_TOKEN` cannot trigger workflows except through an explicit `workflow_dispatch`
# (cf. https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow),
# thus creating the pull request above does not cause any workflow to run.
# Trigger the workflow manually:
gh workflow run --ref "${update_branch}" ci-jekyll.yml
fi
Loading
Loading