Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Manuel Bojato
    @KingDarBoja
    image.png
    Manuel Bojato
    @KingDarBoja
    Work for less than 1 second locally then same text as prod shows up
    image.png
    So weird... any ideas what is happening?
    image.png
    Manuel Bojato
    @KingDarBoja
    Ok, it stopped happening, so weird
    What I changed: Put a styleUrls on my BlogPostComponent, which seems to be the possible cause of previous behaviour
    Sander Elias
    @SanderElias
    @KingDarBoja There was a bug in one of our versions that would do that under certain circumstances. afaik this is fixed a while ago, are you on a current version?
    Sander Elias
    @SanderElias
    @/all Scully office hours now. With a cool presentation.
    Sander Elias
    @SanderElias
    Sorry, due to some punks we can't accept anyone in anymore.
    Manuel Bojato
    @KingDarBoja
    @SanderElias Yeah, I just checked the changelog, updated to beta 1.0.0 version and it is gone :)
    danhpham511998
    @danhpham511998
    Hi @all, I have error when run npm run jam. please help me tks.
    image.png
    Sander Elias
    @SanderElias
    @danhpham511998 Well, the good thing is, Scully is done. The strange thing is, that error should be impossible at that time.
    I would welcome a way to reproduce this.
    danhpham511998
    @danhpham511998
    @SanderElias thanks you.
    Stepan Suvorov
    @stevermeister
    I just found that in terms of code highlight Scully switched to prism? (https://scully.io/docs/learn/utilities/syntax-highlighting/prism-js/)
    instead of internal highlight with highlightjs
    Manuel Bojato
    @KingDarBoja
    I have used both but PrismJS seems to be more easy to customize / setup
    Sander Elias
    @SanderElias
    @KingDarBoja Prism is indeed easier to customize, that's why we switched. Also it supports more languages out of the box.
    Manuel Bojato
    @KingDarBoja
    :heart: Nice
    I am going to include it on my personal blog, just need to look at docs when I get the time
    Is there any schematic to setup PrismJS on Angular + Scully?
    s0l0c0ding
    @s0l0c0ding
    @SanderElias Hi, moving to prism.js from
    highlight.js broke my java code highlighting, java is a supported lang , so i dont know why this code is getting fired from the markdown plugin? highlight: (code, lang) => { if (!Prism.languages[lang]) { console.error(`Language '${lang}' is not available in Prism.js, ignoring syntax highlighting for this code block.`); return code; }
    7 replies
    urjathakkar
    @urjathakkar
    image.png
    8 replies
    etavener
    @etavener
    Hi I was wondering if someone could help me with an idea, not sure if it's possible.
    I have some global data ( a menu API that is the same on all pages) that i would like to not request each time a page is visited. Is it possible to to create a plugin that makes the api requests and creates / updates each data.json with the data (via transferState) before visiting each route in the list with puppeteer.
    Sander Elias
    @SanderElias
    @etavener easy way, request in using tranferstate in a service in your app, that you then use wherever you need the data.
    15 replies
    It is possible to inject transferstate with route-plugins. So you can do what you want by wrapping all the route plugins you use in some custom router-plugin
    3rth way is use the proccessRoute (or routeProccess) plugin, and add it to each and every route in there.
    4rth way, use the 'preRender' function on each route to inject this data.
    Preston Lamb
    @pjlamb12
    I'm having issues deploying to Netlify. The project runs perfectly on my local machine, and maybe takes a minute or two at most to build. But when I deploy to Netlify, the build just hangs. The Angular project successfully builds, and then Scully discovers the routes before no longer moving on. I'm setting the NODE_VERSION to 12 in the netlify.toml file as well, but that doesn't seem to have helped.
    1 reply
    Valentyn Vasylevskyy
    @valpioner

    Hello. I have a strange and annoying post list disappearing on my home page where I list all blog posts.
    Can someone explain why I have such behavior and how to fix it?

    1. When I load a page - a list is loaded and rendered.
    2. scully-routes.json starts to load and list of posts disappear
    3. When scully-routes.json finish loading - content is back again on a page

    in a component i have

    $blogPosts = this.scully.available$.pipe(
        map((routes) =>
          routes.filter(
            (route) =>
              route.route.startsWith('/blog/') && route.sourceFile.endsWith('.md')
          )
        )
      );

    in a template i have

    <div *ngFor="let post of $blogPosts | async">
    
                <div class="uk-card uk-card-default uk-card-hover uk-card-small" routerLink="/blog/{{post.slug}}">
                  <div class="uk-card-media-top">
                    <img src={{post.thumbnail}} alt="">
                  </div>
                  <div class="uk-card-body">
                    <h3 class="uk-card-title">{{post.title}}</h3>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
                  </div>
                </div>
    
              </div>
    Valentyn Vasylevskyy
    @valpioner
    1.gif
    Sander Elias
    @SanderElias
    Use the TransferStateService, that way, your list of blog-posts is there before the angular component destroy's the list and starts over.
    If you have anything async in your app's boot path, you will get a visible flash. Transferstate is sync on boot.
    @pjlamb12 We are looking into the netlify thing.
    Valentyn Vasylevskyy
    @valpioner
    @SanderElias thanks, will try
    Valentyn Vasylevskyy
    @valpioner

    @SanderElias I fixed my issue thanks to your suggestion.

    used this code instead of simple get data observable:

    this.blogPosts$ = this.transferStateService.useScullyTransferState(
          'allPosts',
          this.scully.available$.pipe(
            map((routes) =>
              routes.filter(
                (route) =>
                  route.route.startsWith('/blog/') &&
                  route.sourceFile.endsWith('.md')
              )
            )
          )
        );

    BTW useScullyTransferState is not included and described in the official documentation,
    I would suggest to add it there as well as a few examples of how to use it for async operations.

    etavener
    @etavener
    I've got a strange issue with fragments. When i visit a page like path/page#fragmentI get the correct static page displayed. However, it redirects to path/page/#fragment so when Angular loads there seems to be an issue with displaying the page. Was this feature intentional and is there a way to stop it redirecting / modifying the path with the additional / at the end?
    32 replies
    Valentyn Vasylevskyy
    @valpioner
    When I navigate to a specific blog post, the post itself has a delay to load ( inside <scully-content></scully-content>).
    Did I miss something or that is how it should behave?
    (Gif below is in slow 3g, but in online it is still blinking)
    3.gif
    I see it inside my index.html
    image.png
    Valentyn Vasylevskyy
    @valpioner
    is there a way to cache post content? (inside <scully-content></scully-content>)
    Sander Elias
    @SanderElias
    @valpioner We do already embed it in your HTML file, so yes, it is "cached". Try running your page with javascript disabled.
    Probably something in your app is removing the static version that is there when you load the page.
    18 replies
    s0l0c0ding
    @s0l0c0ding
    @SanderElias i noticed that the page: https://scully.io/docs/learn/plugins/built-in-plugins/md/ didn't get rendered correctly, did i miss something?
    Valentyn Vasylevskyy
    @valpioner
    image.png
    Sander Elias
    @SanderElias
    @valpioner #79