Giter VIP home page Giter VIP logo

Comments (6)

erbill avatar erbill commented on June 14, 2024 1

Oh thats great! Thank you so much, now I can get into customizing even more, amazing.

from adocs.

erbill avatar erbill commented on June 14, 2024 1

I've found the relevant information on vitepress docs;
pasting it here incase somebody has a similar question.
https://vitepress.dev/reference/default-theme-home-page

Features section

features:

  • icon: ⚡️
    title: 3D Renders
    details: Elevate your stores visuals
    link: /renders.md
    linkText: Read More

    it seems we can even add custom link description as well.

from adocs.

Evavic44 avatar Evavic44 commented on June 14, 2024

Hey, @erbill sure you can. Vitepress is markdown so it also supports HTML code.

In the index.md, at the bottom of the layout, you can add a simple markup like this.

<div class="read-more">
  <h1>Read More</h1>
  <p>Click the link below to read more</p>
  <button class="btn">Read More</button>
</div>

And style the read-more class from within the docs\.vitepress\theme\custom.css file

Here's a simple example I just did.

.read-more {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  margin-top: 4rem;
}

.read-more h1 {
  font-size: 2.2rem;
  font-weight: 600;
}

.read-more .btn {
  border: 1px solid var(--vp-c-brand-darker);
  color: white;
  border-radius: 10px;
  padding: 0.4rem 1.4rem;
}

And this is the output.

read more example

Of course, you have to be careful of your class names to avoid overwriting built-in classes on the vitepress theme. A good example of classes to avoid is the container.

Hope this helps. :)

from adocs.

erbill avatar erbill commented on June 14, 2024

After fiddling around I've managed to add extra sections with custom HTML as you suggested.

But I think what I'm trying to recreate can be even way easier than doing all with custom HTML, because I think Features section kind of uses some template documentation?

https://developer.stackblitz.com/

on this page, they've managed to turn feature divs into link blocks. That's actually what I'm trying to make as well.

now the features part of index.md is

Features section

features:

  • icon: ⚡️
    title: 3D Renders
    details: Elevate your stores visuals

  • icon: 🎉
    title: Musics to Play in your store
    details: Inspiring songs and our journey

  • icon: 🔥
    title: Amazing Lifestyle photos
    details: Ready for emailings or your online store

  • icon: 🎀
    title: Gift personalization ideas
    details: Great list of personalization ideas

    what kind of re formating turns this into link blocks? Is there any markdown way of doing it or shall I delete this part and try to re-make the same layout with custom HTML and CSS?

from adocs.

erbill avatar erbill commented on June 14, 2024

I've just tried adding link: /sample.md to any of the features and it turned into a link block as I wanted.

features:

  • icon: ⚡️
    title: 3D Renders
    details: Elevate your stores visuals
    link: /sample.md

    Is there any documentation on where could I've found this, because I might be missing many more features. and couldn't find it on vitepress docs about template details and features.

from adocs.

Evavic44 avatar Evavic44 commented on June 14, 2024

Just in case you need something more dynamic, you can also use VueJS within vitepress, this is actually how Stackblitz customized their docs home page.

from adocs.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.