Package org.opoo.press.source

Examples of org.opoo.press.source.Source


   
    SourceEntry sourceEntry = new SourceEntry(file);
    List<String> metaLines = new ArrayList<String>();
    boolean hasFrontMatter = true;
    try {
      Source source = sourceParser.parse(sourceEntry);
      Map<String, Object> meta = source.getMeta();
      if(!meta.containsKey("layout")){
        metaLines.add("layout: post");
      }
      if(!meta.containsKey("date")){
        metaLines.add("date: '" + DATE_FORMAT.format(date) + "'");
View Full Code Here


        return;
      }
      if(isSourceFile(file)){
        SourceEntry sourceEntry = loadSourceEntry(site.getSource(), file);
        try {
          Source source = Application.getContext().getSourceParser().parse(sourceEntry);
          if(! showDrafts && isDraft(source.getMeta())){     
            log.info("showDrafts = false: Draft post file '" + file + "' changed, skip regenerate.");
            return;
          }
         
          log.info("Source file '" + file + "' changed, regenerate site.");
View Full Code Here

   * @param file - other source directory
   */
  private void otherSourceFileChanged(File file){
    SourceEntry sourceEntry =  new SourceEntry(null, file);
    try {
      Source source = Application.getContext().getSourceParser().parse(sourceEntry);
      if(! showDrafts && isDraft(source.getMeta())){     
        log.info("showDrafts = false: Draft post file '" + file + "' changed, skip regenerate.");
        return;
      }
     
      log.info("Source file '" + file + "' changed, regenerate site.");
View Full Code Here

  /**
   * @param en
   */
  private void read(SourceEntry en, SourceParser parser) {
    try {
      Source src = parser.parse(en);
      log.debug("read source " + src.getSourceEntry().getFile());
     
      Map<String, Object> map = src.getMeta();
      String layout = (String) map.get("layout");
      if("post".equals(layout)){
        readPost(src);
      }else{
        pages.add(new PageImpl(this, src));
View Full Code Here

TOP

Related Classes of org.opoo.press.source.Source

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.