1"use strict";(globalThis.webpackChunkdoteki_website=globalThis.webpackChunkdoteki_website||[]).push([[308],{2641(e,t,n){n.d(t,{A:()=>i});const i=n.p+"assets/images/newrepo_dark-378b88bad8aa474eec7096bc4be2a7b2.png"},3777(e,t,n){n.d(t,{A:()=>i});const i=n.p+"assets/images/newrepo_light-745ce0ebd6d1a8869a67e57405b92fa0.png"},3780(e,t,n){n.d(t,{A:()=>i});const i=n.p+"assets/images/profile_light-3aebe8684633252f3dbf20205a4f62a2.png"},6154(e,t,n){n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>h});const i=JSON.parse('{"id":"index","title":"Getting Started","description":"Let\'s set up a GitHub profile with dynamic content using d\u014dteki in less than 5 minutes.","source":"@site/docs/index.mdx","sourceDirName":".","slug":"/","permalink":"/docs/","draft":false,"unlisted":false,"editUrl":"https://github.com/welpo/doteki/tree/main/website/docs/index.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"tutorialSidebar","next":{"title":"Installing d\u014dteki","permalink":"/docs/installation"}}');var o=n(4848),s=n(8453),r=(n(6540),n(5293));const l=({lightSrc:e,darkSrc:t,alt:n,...i})=>{const{colorMode:s}=(0,r.G)();return(0,o.jsx)("img",{src:"dark"===s?t:e,alt:n,...i})},a={sidebar_position:1},d="Getting Started",c={},h=[{value:"Initial setup",id:"initial-setup",level:2},{value:"Running d\u014dteki",id:"running-d\u014dteki",level:2},{value:"Result",id:"result",level:2},{value:"Automating the process",id:"automating-the-process",level:2},{value:"GitHub action",id:"github-action",level:3},{value:"Cron job",id:"cron-job",level:3},{value:"Webhooks",id:"webhooks",level:3},{value:"Further reading",id:"further-reading",level:2}];function u(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"getting-started",children:"Getting Started"})}),"\n",(0,o.jsxs)(t.p,{children:["Let's set up a GitHub profile with dynamic content using ",(0,o.jsx)(t.strong,{children:"d\u014dteki"})," in less than 5 minutes."]}),"\n",(0,o.jsx)(t.h2,{id:"initial-setup",children:"Initial setup"}),"\n",(0,o.jsxs)(t.p,{children:["First, ",(0,o.jsx)(t.a,{href:"https://github.com/new",children:"create a new public repository"})," with a name that matches your GitHub username:"]}),"\n",(0,o.jsx)(l,{lightSrc:n(3777).A,darkSrc:n(2641).A,alt:"GitHub screenshot showing the creation of a repository named 'welpo' for the user 'welpo'"}),"\n",(0,o.jsxs)(t.p,{children:["In the root of the repository, you'll need to two files: a configuration file and a ",(0,o.jsx)(t.code,{children:"README.md"})," file. Let's clone the repository and create the files:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"# Replace `welpo` with your GitHub username.\ngit clone https://github.com/welpo/welpo.git\ncd welpo\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The contents of the ",(0,o.jsx)(t.code,{children:"README.md"})," file will be shown on your GitHub profile. Here you'll need to add ",(0,o.jsx)(t.strong,{children:"sections"})," with markers (invisible HTML comments) so d\u014dteki knows where to place the content generated by the plugins. For this example, let's add recent blogposts and the current date:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-md",metastring:'title="README.md"',children:"## Latest blog posts\n\n\x3c!-- blog start --\x3e\n\x3c!-- blog end --\x3e\n\n<sub>Last updated on \x3c!-- last_updated start --\x3e\x3c!-- last_updated end --\x3e</sub>\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The configuration file tells d\u014dteki which plugins to use and how to configure them. Create a ",(0,o.jsx)(t.code,{children:"doteki.toml"})," file in the root of the repository with the following content:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-toml",metastring:'title="doteki.toml"',children:'[sections.blog]\nplugin = "feed"\nurl = "https://osc.garden/atom.xml" # Replace with your feed.\n\n[sections.last_updated]\nplugin = "current_date"\ninline = true\n'})}),"\n",(0,o.jsxs)(t.p,{children:["Each set of markers in your ",(0,o.jsx)(t.code,{children:"README.md"})," must have a matching ",(0,o.jsx)(t.code,{children:"sections.<name>"})," entry in ",(0,o.jsx)(t.code,{children:"doteki.toml"}),". If your markers were ",(0,o.jsx)(t.code,{children:"\x3c!-- personal_blog start --\x3e"})," and ",(0,o.jsx)(t.code,{children:"\x3c!-- personal_blog end --\x3e"}),", the corresponding entry in the configuration file would be ",(0,o.jsx)(t.code,{children:"[sections.personal_blog]"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"The setup is complete! Now we need to run d\u014dteki to generate the content."}),"\n",(0,o.jsx)(t.h2,{id:"running-d\u014dteki",children:"Running d\u014dteki"}),"\n",(0,o.jsxs)(t.p,{children:["If you plan on using the ",(0,o.jsx)(t.a,{href:"#github-action",children:"GitHub Action"}
1),", you can skip this section."]}),"\n",(0,o.jsxs)(t.p,{children:["You can run d\u014dteki locally after ",(0,o.jsx)(t.a,{href:"/docs/installation",children:"installing it"})," with ",(0,o.jsx)(t.code,{children:"pip"}),":"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"pip install doteki[all]\n"})}),"\n",(0,o.jsx)(t.p,{children:"Once installed, you run d\u014dteki from the root of the repository:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"doteki\n"})}),"\n",(0,o.jsxs)(t.p,{children:["This will automatically find ",(0,o.jsx)(t.code,{children:"doteki.toml"})," and ",(0,o.jsx)(t.code,{children:"README.md"})," in the current directory and update the sections in the ",(0,o.jsx)(t.code,{children:"README.md"})," file."]}),"\n",(0,o.jsx)(t.h2,{id:"result",children:"Result"}),"\n",(0,o.jsx)(t.p,{children:"After pushing the changes to GitHub, your profile would look like this:"}),"\n",(0,o.jsx)(l,{lightSrc:n(3780).A,darkSrc:n(9290).A,alt:"GitHub profile showing the latest blog posts and the current date"}),"\n",(0,o.jsx)(t.h2,{id:"automating-the-process",children:"Automating the process"}),"\n",(0,o.jsx)(t.p,{children:"Whether you want to do this on a schedule or on every push to a repository, there are a few ways to automate the process."}),"\n",(0,o.jsx)(t.h3,{id:"github-action",children:"GitHub action"}),"\n",(0,o.jsxs)(t.p,{children:["The simplest way to run d\u014dteki automatically is to use the ",(0,o.jsx)(t.a,{href:"https://github.com/welpo/doteki-action",children:"GitHub Action"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In short: create the workflow file ",(0,o.jsx)(t.code,{children:".github/workflows/doteki.yml"})," with the following content:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-yaml",metastring:'title=".github/workflows/doteki.yml"',children:"name: Update README with d\u014dteki\n\non:\n push:\n workflow_dispatch:\n schedule:\n - cron: '51 * * * *' # Every hour at XX:51.\n\njobs:\n update-readme:\n runs-on: ubuntu-latest\n permissions:\n contents: write # Necessary to push changes.\n steps:\n - name: Run d\u014dteki action\n uses: welpo/doteki-action@main\n env:\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"})}),"\n",(0,o.jsx)(t.p,{children:"This will update your profile every hour at XX:51, whenever you push to the repository, or when you manually run the workflow."}),"\n",(0,o.jsxs)(t.p,{children:["For more information, see the ",(0,o.jsxs)(t.a,{href:"https://github.com/welpo/doteki-action",children:[(0,o.jsx)(t.code,{children:"doteki-action"})," README"]}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"cron-job",children:"Cron job"}),"\n",(0,o.jsx)(t.p,{children:"You can configure a cron job to run d\u014dteki locally on a schedule and push the commit."}),"\n",(0,o.jsxs)(t.p,{children:["Run ",(0,o.jsx)(t.code,{children:"crontab -e"})," to edit your cron jobs and add a line like this:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:'51 * * * * cd /path/to/repo && /full/path/to/doteki && git add README.md && git commit -m "Update README" && git push\n'})}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Important"}),":"]}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"Use the full path to d\u014dteki."}),"\n",(0,o.jsxs)(t.li,{children:["Change ",(0,o.jsx)(t.code,{children:"/path/to/repo"})," to the path of your repository."]}),"\n",(0,o.jsxs)(t.li,{children:["On macOS, grant ",(0,o.jsx)(t.code,{children:"/usr/bin/cron"})," Full Disk Access. See ",(0,o.jsx)(t.a,{href:"https://stackoverflow.com/a/68288682",children:"this stackoverflow answer"})," for more information."]}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"This will run d\u014dteki every hour at XX:51 and push the changes to GitHub."}),"\n",(0,o.jsx)(t.h3,{id:"webhooks",children:"Webhooks"}),"\n",(0,o.jsx)(t.p,{children:"If you want to update your profile on every push to a repository (say, your blog's repository), you can configure a webhook to run d\u014dteki on every push."}),"\n",(0,o.jsxs)(t.p,{children:["This is a bit more involved, but if you're already using a webhook for building your site (here's a ",(0,o.jsx)(t.a,{href:"https://osc.garden/blog/updating-site-with-webhook/",children:"guide for Zola and GitHub"}),"), you can just add d\u014dteki at the end of the build process."]}),"\n",(0,o.jsx)(t.h2,{id:"further-reading",children:"Further reading"}),"\n",(0,o.jsxs)(t.p,{children:["Check out the ",(0,o.jsx)(t.a,{href:"/docs/category/plugins",children:"list of plugins"})," to see what you can do with d\u014dteki."]}),"\n",(0,o.jsxs)(t.p,{children:["See ",(0,o.jsx)(t.a,{href:"/docs/configuration/plugin-configuration",children:"Plugin Configuration"})," for more information on how to configure plugins."]})]})}function p(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},8453(e,t,n){n.d(t,{R:()=>r,x:()=>l});var i=n(6540);const o={},s=i.createContext(o);function r(e){const t=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:t},e.children)}},9290(e,t,n){n.d(t,{A:()=>i});const i=n.p+"assets/images/profile_dark-4fb088893dae14ab0a1d296e99e922f3.png"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.