### Preview Introduction Theme Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Starts a local Hugo server to preview the Introduction theme using the fully configured example site. Visit http://localhost:1313/ to view. ```sh cd exampleSite && HUGO_THEME="hugo-theme-introduction" hugo server --themesDir ../.. ``` -------------------------------- ### Example Site Configuration Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/exampleSite/content/en/blog/configuration.md This TOML snippet displays the complete configuration for the example site, serving as a reference for customization. ```toml languageCode = "en-us" baseURL = "https://example.com/" language = "en" theme = "introduction" [params] # Default author for posts author = "John Doe" # Default date for posts date = "2020-07-25T02:04:06-05:00" # Default tags for posts tags = ["code", "features"] # Default series for posts series = ["quickstart"] # Site title title = "Introduction Theme" # Site subtitle subtitle = "A Hugo theme for personal sites and blogs." # Navigation links [[params.links]] name = "Home" url = "/" weight = 1 [[params.links]] name = "About" url = "/about/" weight = 2 [[params.links]] name = "Contact" url = "/contact/" weight = 3 # Social media links [[params.social]] name = "GitHub" url = "https://github.com/victoriadrake/hugo-theme-introduction" [[params.social]] name = "Twitter" url = "https://twitter.com/victoriadrake" [[params.social]] name = "LinkedIn" url = "https://www.linkedin.com/in/victoriadrake/" # Syntax Highlighting [markup] [markup.highlight] codeFences = true guessSyntax = false hl_Lines = "" lineNoStart = 1 lineNos = false lineNumbersInTable = true noClasses = true # For styles, see https://xyproto.github.io/splash/docs/longer/all.html style = "friendly" tabWidth = 4 # Goldmark Markdown Renderer [markup.goldmark.renderer] unsafe = true ``` -------------------------------- ### Install npm Packages Locally in exampleSite Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Installs PostCSS, PostCSS CLI, and Autoprefixer locally within the exampleSite directory. This is necessary if Hugo is used as a snap app. ```sh cd exampleSite/ npm i postcss postcss-cli autoprefixer ``` -------------------------------- ### Install Bulma with Yarn Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/assets/vendor/bulma/README.md Use this command to install Bulma using Yarn. ```sh yarn add bulma ``` -------------------------------- ### Copy Example Content Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Copy the example site content to the root of your Hugo site. This command should be run from the Hugo site's root directory. ```bash cp -a themes/hugo-serif-theme/exampleSite/. . ``` -------------------------------- ### Install Bulma with Bower Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/assets/vendor/bulma/README.md Use this command to install Bulma using Bower. ```sh bower install bulma ``` -------------------------------- ### Run Local Server from Example Site Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Develop the theme locally by running the server directly from the exampleSite folder. This command is useful for theme development. ```bash hugo server --source=exampleSite --theme=../.. ``` -------------------------------- ### Configure Logo in config.toml Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Example of how to configure the logo by editing the `config.toml` file. ```toml logo = "images/logo.svg" logo_width = "200" logo_height = "50" ``` -------------------------------- ### Run Hugo Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Generate the Hugo site after installation. Run this from the root folder of your Hugo site. ```bash hugo ``` -------------------------------- ### Install Bulma with NPM Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/assets/vendor/bulma/README.md Use this command to install Bulma using the Node Package Manager. ```sh npm install bulma ``` -------------------------------- ### Install Linux .deb Package Source: https://github.com/ferranpons/llamatik/blob/main/homepage/content/es/download/_index.md Use this command to install the Llamatik .deb package on Debian/Ubuntu-based systems. Ensure you have the package downloaded first. ```bash sudo dpkg -i llamatik_1.8.0_amd64.deb ``` -------------------------------- ### Create a New Hugo Site Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Use this command to create a fresh Hugo site. Ensure you have Hugo Extended installed. ```bash hugo new site mynewsite ``` -------------------------------- ### Run Local Hugo Server Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Start Hugo's built-in local server for development. Access the site at localhost:1313. ```bash hugo server ``` -------------------------------- ### Quick Start: Load Model and Generate Text with Llamatik Source: https://github.com/ferranpons/llamatik/blob/main/README.md Demonstrates the basic steps to initialize the LlamaBridge, load a model, and generate text. Model path resolution and parameter tuning are shown. ```kotlin // Resolve model path (place GGUF in assets / bundle) val modelPath = LlamaBridge.getModelPath("phi-2.Q4_0.gguf") // (Optional) tune parameters before loading — contextLength/useMmap/flashAttention // take effect at model init time; the others can be changed at any time LlamaBridge.updateGenerateParams( temperature = 0.7f, maxTokens = 512, topP = 0.95f, topK = 40, repeatPenalty = 1.1f, contextLength = 4096, numThreads = 4, useMmap = true, flashAttention = false, ) // Load model LlamaBridge.initGenerateModel(modelPath) // Generate text val output = LlamaBridge.generate( "Explain Kotlin Multiplatform in one sentence." ) ``` -------------------------------- ### Create New Project Content File Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Run this command to create a new markdown file for a specific project. The frontmatter of this file contains comments to guide project configuration. ```sh hugo new projects/YourProjectName/_index.md ``` -------------------------------- ### Configure Hugo Syntax Highlighting Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/exampleSite/docs/index.html Example configuration for Hugo's built-in syntax highlighting. Adjust settings like codeFences, guessSyntax, and line numbers as needed. ```toml [markup] [markup.highlight] codeFences = true guessSyntax = false hl_Lines = "" lineNoStart = 1 lineNos = false lineNumbersInTable = true noClasses = true ``` -------------------------------- ### Cash Flow Calculation Example Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/exampleSite/content/services/accounting.md Demonstrates a simple cash flow calculation for a personal scenario. It highlights cash inflows, outflows, and the opening balance to determine the closing balance. ```plaintext Cash inflow: $20 * Cash outflow:$7 * Opening balance: $5 * Closing balance: $20 – $7 + $5 = $18 ``` -------------------------------- ### PromptTemplate Usage Source: https://context7.com/ferranpons/llamatik/llms.txt Demonstrates how to access and use different built-in PromptTemplate implementations for various models like Gemma 3, Llama 3 Instruct, Qwen Chat, and a generic Plain format. It also shows how to manually render prompts using PromptRenderer. ```APIDOC ## PromptTemplate — Model-agnostic prompt templates `PromptTemplate` is a sealed interface with built-in implementations for Gemma 3, Llama 3 Instruct, Qwen Chat, and a generic Plain format. Used by `PromptRenderer` and `ChatRunner` when the loaded model has no embedded Jinja chat template. ```kotlin import com.llamatik.app.feature.chatbot.utils.* // Available templates val gemma3 : PromptTemplate = Gemma3 // / val llama3 : PromptTemplate = Llama3Instruct // <> / ### User / ### Assistant val qwen : PromptTemplate = QwenChat // <|im_start|> / <|im_end|> val plain : PromptTemplate = Plain // Generic System: / User: / Assistant: println(Gemma3.name) // → "gemma3" println(Gemma3.stopSequences) // → ["", "<|eot_id|>", "assistant"] // Manual prompt rendering (used when model has no embedded template) val messages = listOf( ChatMessage(ChatMessage.Role.System, "You are a helpful assistant."), ChatMessage(ChatMessage.Role.User, "What is Flow in Kotlin?"), ChatMessage(ChatMessage.Role.Assistant, "Flow is a cold asynchronous data stream."), ChatMessage(ChatMessage.Role.User, "How does it differ from LiveData?"), ) val renderedPrompt = PromptRenderer.render( system = "You are a helpful assistant.", contexts = emptyList(), messages = messages, template = Llama3Instruct ) println(renderedPrompt) ``` ``` -------------------------------- ### Install npm Packages for PostCSS Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Installs PostCSS, PostCSS CLI, and Autoprefixer globally. These are required for theme CSS compilation when using extended Hugo versions. ```sh npm i -g postcss postcss-cli autoprefixer ``` -------------------------------- ### PromptTemplate Implementations and Rendering Source: https://context7.com/ferranpons/llamatik/llms.txt Demonstrates the usage of different PromptTemplate implementations for various models and manual prompt rendering when a model lacks an embedded template. Ensure correct imports for PromptTemplate and ChatMessage. ```kotlin import com.llamatik.app.feature.chatbot.utils.* // Available templates val gemma3 : PromptTemplate = Gemma3 // / val llama3 : PromptTemplate = Llama3Instruct // <> / ### User / ### Assistant val qwen : PromptTemplate = QwenChat // <|im_start|> / <|im_end|> val plain : PromptTemplate = Plain // Generic System: / User: / Assistant: println(Gemma3.name) // → "gemma3" println(Gemma3.stopSequences) // → ["", "<|eot_id|>", "assistant"] // Manual prompt rendering (used when model has no embedded template) val messages = listOf( ChatMessage(ChatMessage.Role.System, "You are a helpful assistant."), ChatMessage(ChatMessage.Role.User, "What is Flow in Kotlin?"), ChatMessage(ChatMessage.Role.Assistant, "Flow is a cold asynchronous data stream."), ChatMessage(ChatMessage.Role.User, "How does it differ from LiveData?") ) val renderedPrompt = PromptRenderer.render( system = "You are a helpful assistant.", contexts = emptyList(), messages = messages, template = Llama3Instruct ) println(renderedPrompt) ``` -------------------------------- ### Import Bulma CSS Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/assets/vendor/bulma/README.md Import the main Bulma CSS file into your project after installation. ```javascript import 'bulma/css/bulma.css' ``` -------------------------------- ### Create New Project Index File Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Use this command to generate the index file for a new project within the 'projects' directory. This file serves as the main entry point for project-specific content. ```sh hugo new projects/_index.md ``` -------------------------------- ### ChatMessage History Example Source: https://context7.com/ferranpons/llamatik/llms.txt Illustrates the creation of a list of ChatMessage objects to represent a conversation history. This is used by ChatRunner and PromptRenderer. ```kotlin import com.llamatik.app.feature.chatbot.utils.ChatMessage val history = listOf( ChatMessage(role = ChatMessage.Role.System, content = "You are a concise assistant."), ChatMessage(role = ChatMessage.Role.User, content = "What is Kotlin?"), ChatMessage(role = ChatMessage.Role.Assistant, content = "Kotlin is a modern JVM language by JetBrains."), ChatMessage(role = ChatMessage.Role.User, content = "Is it open source?") ) ``` -------------------------------- ### LlamaBridge.generate Source: https://context7.com/ferranpons/llamatik/llms.txt Performs one-shot text generation synchronously. Starts a fresh KV state on each call and is not recommended on the UI thread. ```APIDOC ## LlamaBridge.generate — One-shot text generation Synchronous, blocking. Starts a fresh KV state on each call. Not recommended on the UI thread. ```kotlin val response: String = LlamaBridge.generate( "Explain Kotlin Multiplatform in two sentences." ) println(response) // → "Kotlin Multiplatform lets you share business logic across Android, iOS, // desktop, and web while keeping native UIs. It compiles to JVM bytecode, // native binaries, and WebAssembly from a single codebase." ``` ``` -------------------------------- ### Create New Blog Index File Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/README.md Generate the index file for the blog section using this command. This file is essential for organizing and displaying blog posts on the homepage. ```sh hugo new blog/_index.md ``` -------------------------------- ### Cash Flow Statement Example 2 Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/exampleSite/content/services/tax-preperation.md Demonstrates a cash flow statement for a company, highlighting the distinction between cash transactions and credit. ```plaintext Important: the cash flow statement only considers the exchange of actual cash, and ignores what the person in question owes or is owed. ``` -------------------------------- ### Install Hugo Serif Theme Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/hugo-serif-theme/README.md Clone the theme into your Hugo site's themes directory. This command assumes you are in the root of your Hugo site. ```bash cd mynewsite git clone https://github.com/zerostaticthemes/hugo-serif-theme.git themes/hugo-serif-theme ``` -------------------------------- ### Basic Introduction Theme Configuration Source: https://github.com/ferranpons/llamatik/blob/main/homepage/docs/blog/configuration/index.html Essential configuration for the Introduction Hugo theme. Includes site-wide settings like baseURL, theme, default language, and theme style. ```toml baseURL = "http://example.com/" # Your domain name. Must end with "/" theme = "introduction" DefaultContentLanguage = "en" # Default language for multilingual sites # disqusshortname = "" # https://gohugo.io/content-management/comments # googleAnalytics = "" # https://gohugo.io/templates/internal/#google-analytics [params] themeStyle = "light" # Choose "light" or "dark" favicon = "/img/fav.ico" # Path to favicon file showRSSButton = false # Show rss button in navigation fadeIn = true # Turn on/off the fade-in effect fadeInIndex = false # Turn on/off the fade-in effect on the index page even if fade-in was otherwise turned off dateFormat = "Jan 2, 2006" email = "youremail@email.com" # E-mail address for contact section # customCSS = ["foo.css"] # Include custom css files placed under assets/ # Configure the home page [params.home] introHeight = "fullheight" # Input either "medium" or "large" or "fullheight" showLatest = true # Show latest blog post summary showAllPosts = false # Set true to list all posts on home page, or set false to link to separate blog list page numberOfProjectsToShow = 3 # Maximum number of projects to show on home page. Unset or comment out to show all projects localTime = true # Show your current local time in contact section ``` -------------------------------- ### JavaScript Function Example Source: https://github.com/ferranpons/llamatik/blob/main/homepage/docs/blog/coffee-ipsum/index.html A simple JavaScript arrow function that logs a message to the console. Useful for basic testing or demonstrating function definition. ```javascript const thisIsATest = () => { console.log("This is funny") } ``` -------------------------------- ### Basic Introduction Theme Configuration Source: https://github.com/ferranpons/llamatik/blob/main/homepage/themes/introduction/exampleSite/docs/blog/configuration/index.html Essential configuration for the Introduction Hugo theme, including baseURL, theme, default language, and basic theme parameters. ```toml baseURL = "http://example.com/" # Your domain name. Must end with "/" theme = "introduction" DefaultContentLanguage = "en" # Default language for multilingual sites # disqusshortname = "" # https://gohugo.io/content-management/comments # googleAnalytics = "" # https://gohugo.io/templates/internal/#google-analytics [params] themeStyle = "light" # Choose "light" or "dark" favicon = "/img/fav.ico" # Path to favicon file showRSSButton = false # Show rss button in navigation fadeIn = true # Turn on/off the fade-in effect fadeInIndex = false # Turn on/off the fade-in effect on the index page even if fade-in was otherwise turned off dateFormat = "Jan 2, 2006" email = "youremail@email.com" # E-mail address for contact section # customCSS = ["foo.css"] # Include custom css files placed under assets/ # Configure the home page [params.home] introHeight = "fullheight" # Input either "medium" or "large" or "fullheight" showLatest = true # Show latest blog post summary showAllPosts = false # Set true to list all posts on home page, or set false to link to separate blog list page numberOfProjectsToShow = 3 # Maximum number of projects to show on home page. Unset or comment out to show all projects localTime = true # Show your current local time in contact section ```